{"id":940461,"date":"2024-12-26T21:00:34","date_gmt":"2024-12-26T13:00:34","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/940461.html"},"modified":"2024-12-26T21:00:35","modified_gmt":"2024-12-26T13:00:35","slug":"%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80python-shell","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/940461.html","title":{"rendered":"\u5982\u4f55\u6253\u5f00python shell"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25075037\/778b4d3f-1463-4f69-9293-5a56f91fbd52.webp\" alt=\"\u5982\u4f55\u6253\u5f00python shell\" \/><\/p>\n<p><p> \u5f00\u5934\u6bb5\u843d\uff1a<br \/><strong>\u6253\u5f00Python Shell\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528Python IDE\u3001\u4f7f\u7528Jupyter Notebook<\/strong>\u3002\u5728\u8fd9\u5176\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u662f\u4e00\u79cd\u975e\u5e38\u76f4\u63a5\u548c\u5feb\u901f\u7684\u65b9\u6cd5\u3002\u4f60\u53ef\u4ee5\u5728\u8ba1\u7b97\u673a\u7684\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff08\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u5b89\u88c5\u7684Python\u7248\u672c\uff09\u6765\u542f\u52a8Python Shell\u3002\u8fd9\u79cd\u65b9\u5f0f\u9002\u5408\u90a3\u4e9b\u5df2\u7ecf\u5728\u7cfb\u7edf\u4e2d\u6b63\u786e\u5b89\u88c5\u4e86Python\u5e76\u4e14\u719f\u6089\u547d\u4ee4\u884c\u64cd\u4f5c\u7684\u7528\u6237\u3002\u542f\u52a8\u540e\uff0c\u4f60\u5c06\u770b\u5230\u4e00\u4e2a\u4ee5<code>&gt;&gt;&gt;<\/code>\u5f00\u5934\u7684\u4ea4\u4e92\u5f0f\u63d0\u793a\u7b26\uff0c\u8868\u793a\u4f60\u73b0\u5728\u53ef\u4ee5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u5176\u8f93\u51fa\u3002\u8fd9\u79cd\u5373\u65f6\u53cd\u9988\u975e\u5e38\u9002\u5408\u8fdb\u884c\u5feb\u901f\u7684\u4ee3\u7801\u6d4b\u8bd5\u548c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u6b63\u6587\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6253\u5f00Python Shell<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u662f\u6253\u5f00Python Shell\u7684\u6700\u57fa\u672c\u65b9\u6cd5\u4e4b\u4e00\u3002\u65e0\u8bba\u662f\u5728Windows\u3001macOS\u8fd8\u662fLinux\u7cfb\u7edf\u4e0a\uff0c\u4f60\u90fd\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python Shell\u3002\u9996\u5148\uff0c\u4f60\u9700\u8981\u786e\u4fddPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u3002\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u5f00\u59cb\u201d\u83dc\u5355\u641c\u7d22\u201ccmd\u201d\u6765\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1b\u5728macOS\u548cLinux\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u7ec8\u7aef\u201d\u5e94\u7528\u7a0b\u5e8f\u8bbf\u95ee\u547d\u4ee4\u884c\u3002<\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff08\u8fd9\u53d6\u51b3\u4e8e\u4f60\u5b89\u88c5\u7684\u7248\u672c\uff09\u6765\u542f\u52a8Python Shell\u3002\u5982\u679c\u4f60\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u8bf7\u786e\u4fdd\u4f7f\u7528\u6b63\u786e\u7684\u547d\u4ee4\u6765\u542f\u52a8\u4f60\u60f3\u8981\u7684\u7248\u672c\u3002\u8f93\u5165\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u5c06\u542f\u52a8Python Shell\uff0c\u5e76\u663e\u793aPython\u7684\u7248\u672c\u4fe1\u606f\u4ee5\u53ca<code>&gt;&gt;&gt;<\/code>\u63d0\u793a\u7b26\u3002<\/p>\n<\/p>\n<p><p>\u547d\u4ee4\u884c\u65b9\u5f0f\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u7b80\u5355\u548c\u5feb\u901f\uff0c\u9002\u5408\u9700\u8981\u9891\u7e41\u8fdb\u884c\u77ed\u4ee3\u7801\u7247\u6bb5\u6d4b\u8bd5\u7684\u7528\u6237\u3002\u5e76\u4e14\uff0c\u547d\u4ee4\u884c\u672c\u8eab\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u91cd\u5b9a\u5411\u8f93\u5165\u8f93\u51fa\u3001\u811a\u672c\u81ea\u52a8\u5316\u7b49\uff0c\u4f7f\u5f97Python Shell\u7684\u4f7f\u7528\u66f4\u52a0\u7075\u6d3b\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528Python IDE\u6253\u5f00Python Shell<\/p>\n<\/p>\n<p><p>\u4f7f\u7528Python IDE\uff08\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff09\u662f\u53e6\u4e00\u79cd\u6253\u5f00Python Shell\u7684\u65b9\u6cd5\u3002\u5e38\u89c1\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001IDLE\u7b49\u3002\u8fd9\u4e9bIDE\u901a\u5e38\u96c6\u6210\u4e86Python Shell\u6216\u4ea4\u4e92\u5f0f\u7ec8\u7aef\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u7f16\u5199\u4ee3\u7801\u7684\u540c\u65f6\u6d4b\u8bd5\u4ee3\u7801\u6bb5\u3002<\/p>\n<\/p>\n<p><p>\u5728PyCharm\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201cTools\u201d\u83dc\u5355\u4e2d\u7684\u201cPython Console\u201d\u9009\u9879\u6253\u5f00Python Shell\u3002\u8fd9\u4e2a\u63a7\u5236\u53f0\u652f\u6301\u8bed\u6cd5\u9ad8\u4eae\u3001\u81ea\u52a8\u5b8c\u6210\u7b49\u529f\u80fd\uff0c\u63d0\u5347\u4e86\u4ee3\u7801\u7f16\u5199\u548c\u8c03\u8bd5\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u5728Visual Studio Code\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u7ec8\u7aef\u6765\u6253\u5f00Python Shell\u3002\u5b89\u88c5Python\u6269\u5c55\u540e\uff0c\u6309\u4e0b\u5feb\u6377\u952e\u201cCtrl + <code>\u201d\uff08\u53cd\u5f15\u53f7\uff09\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<\/code>python`\u547d\u4ee4\u542f\u52a8Python Shell\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528IDE\u7684\u4f18\u52bf\u5728\u4e8e\u96c6\u6210\u4e86\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\uff0c\u9002\u5408\u8fdb\u884c\u8f83\u5927\u9879\u76ee\u7684\u5f00\u53d1\u548c\u7ef4\u62a4\u3002\u800c\u4e14\uff0c\u8fd9\u4e9bIDE\u901a\u5e38\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u63d2\u4ef6\u652f\u6301\uff0c\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u9700\u6c42\u8fdb\u884c\u5b9a\u5236\u5316\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528Jupyter Notebook\u6253\u5f00Python Shell<\/p>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u57fa\u4e8e\u7f51\u9875\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u9886\u57df\u7684Python\u5f00\u53d1\u3002\u901a\u8fc7Jupyter Notebook\uff0c\u4f60\u4e0d\u4ec5\u53ef\u4ee5\u6253\u5f00Python Shell\uff0c\u8fd8\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u73af\u5883\u4e2d\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\u3001\u53ef\u89c6\u5316\u6570\u636e\u4ee5\u53ca\u8bb0\u5f55\u7b14\u8bb0\u3002<\/p>\n<\/p>\n<p><p>\u8981\u4f7f\u7528Jupyter Notebook\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Jupyter\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b89\u88c5\u5b83\uff0c\u547d\u4ee4\u4e3a<code>pip install jupyter<\/code>\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>jupyter notebook<\/code>\u547d\u4ee4\u542f\u52a8\u670d\u52a1\u5668\u3002Jupyter Notebook\u4f1a\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u4e00\u4e2a\u65b0\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u5728\u8fd9\u91cc\u521b\u5efa\u548c\u7ba1\u7406\u7b14\u8bb0\u672c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u5728Jupyter Notebook\u4e2d\uff0c\u6bcf\u4e2a\u5355\u5143\u683c\u90fd\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684Python Shell\u3002\u4f60\u53ef\u4ee5\u5728\u5355\u5143\u683c\u4e2d\u8f93\u5165Python\u4ee3\u7801\u5e76\u8fd0\u884c\uff0c\u7ed3\u679c\u4f1a\u7acb\u5373\u663e\u793a\u5728\u5355\u5143\u683c\u4e0b\u65b9\u3002Jupyter Notebook\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u76f4\u89c2\u7684\u754c\u9762\u548c\u5f3a\u5927\u7684\u53ef\u89c6\u5316\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u7528\u6765\u5904\u7406\u548c\u5206\u6790\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001Python Shell\u7684\u57fa\u672c\u64cd\u4f5c<\/p>\n<\/p>\n<p><p>Python Shell\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u5141\u8bb8\u4f60\u9010\u884c\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u7406\u89e3Python Shell\u7684\u57fa\u672c\u64cd\u4f5c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u5229\u7528\u5b83\u8fdb\u884c\u5f00\u53d1\u548c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u5728Python Shell\u4e2d\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u4efb\u4f55\u6709\u6548\u7684Python\u8bed\u53e5\u5e76\u6309\u56de\u8f66\u952e\u6267\u884c\u3002Python Shell\u4f1a\u7acb\u5373\u663e\u793a\u7ed3\u679c\uff0c\u4f8b\u5982\u6570\u5b66\u8fd0\u7b97\u7684\u7ed3\u679c\u3001\u53d8\u91cf\u7684\u503c\u7b49\u3002Python Shell\u652f\u6301\u6240\u6709\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u548c\u64cd\u4f5c\u7b26\uff0c\u5305\u62ec\u6574\u6570\u3001\u6d6e\u70b9\u6570\u3001\u5b57\u7b26\u4e32\u3001\u5217\u8868\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f60\u8fd8\u53ef\u4ee5\u5728Python Shell\u4e2d\u5b9a\u4e49\u51fd\u6570\u548c\u7c7b\uff0c\u8fd9\u4f7f\u5f97\u5b83\u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8ba1\u7b97\u5de5\u5177\u3002\u901a\u8fc7\u5b9a\u4e49\u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u6d4b\u8bd5\u7b97\u6cd5\u548c\u903b\u8f91\uff0c\u8fdb\u884c\u5feb\u901f\u7684\u539f\u578b\u5f00\u53d1\u3002<\/p>\n<\/p>\n<p><p>Python Shell\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u7279\u6b8a\u547d\u4ee4\uff0c\u4f8b\u5982<code>exit()<\/code>\u548c<code>quit()<\/code>\u7528\u4e8e\u9000\u51faShell\uff0c<code>help()<\/code>\u7528\u4e8e\u67e5\u770b\u5185\u7f6e\u51fd\u6570\u548c\u6a21\u5757\u7684\u5e2e\u52a9\u4fe1\u606f\u3002\u638c\u63e1\u8fd9\u4e9b\u57fa\u672c\u64cd\u4f5c\u53ef\u4ee5\u63d0\u9ad8\u4f60\u5728Python Shell\u4e2d\u7684\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001Python Shell\u7684\u9ad8\u7ea7\u529f\u80fd<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u64cd\u4f5c\uff0cPython Shell\u8fd8\u652f\u6301\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\uff0c\u4f7f\u5f97\u5b83\u5728\u4ee3\u7801\u5f00\u53d1\u548c\u8c03\u8bd5\u4e2d\u66f4\u52a0\u5f3a\u5927\u3002<\/p>\n<\/p>\n<p><p>Python Shell\u652f\u6301\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u548c\u81ea\u52a8\u8865\u5168\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0a\u4e0b\u7bad\u5934\u952e\u6d4f\u89c8\u4e4b\u524d\u8f93\u5165\u7684\u547d\u4ee4\uff0c\u4f7f\u7528Tab\u952e\u8fdb\u884c\u81ea\u52a8\u8865\u5168\u3002\u8fd9\u4e9b\u529f\u80fd\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u8f93\u5165\u6548\u7387\uff0c\u7279\u522b\u662f\u5728\u9700\u8981\u53cd\u590d\u6d4b\u8bd5\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n<\/p>\n<p><p>Python Shell\u8fd8\u652f\u6301\u6a21\u5757\u7684\u5bfc\u5165\u548c\u4f7f\u7528\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u5bfc\u5165Python\u7684\u6807\u51c6\u5e93\u6a21\u5757\u6216\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u8fd9\u4f7f\u5f97Python Shell\u4e0d\u4ec5\u9650\u4e8e\u57fa\u672c\u64cd\u4f5c\uff0c\u8fd8\u53ef\u4ee5\u6267\u884c\u590d\u6742\u7684\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5bfc\u5165<code>math<\/code>\u6a21\u5757\u6267\u884c\u590d\u6742\u7684\u6570\u5b66\u8fd0\u7b97\uff0c\u6216\u5bfc\u5165<code>datetime<\/code>\u6a21\u5757\u5904\u7406\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><p>\u6b64\u5916\uff0cPython Shell\u652f\u6301\u91cd\u5b9a\u5411\u8f93\u5165\u8f93\u51fa\u548c\u811a\u672c\u7684\u6267\u884c\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u91cd\u5b9a\u5411\u64cd\u4f5c\u5c06Python Shell\u7684\u8f93\u51fa\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u6216\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u8f93\u5165\u3002\u8fd9\u79cd\u529f\u80fd\u5728\u81ea\u52a8\u5316\u4efb\u52a1\u548c\u6570\u636e\u5904\u7406\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001Python Shell\u7684\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Python Shell\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u95ee\u9898\u3002\u7406\u89e3\u8fd9\u4e9b\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u52a0\u987a\u5229\u5730\u4f7f\u7528Python Shell\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u4e2a\u5e38\u89c1\u7684\u95ee\u9898\u662f\u542f\u52a8Python Shell\u65f6\u51fa\u73b0\u201ccommand not found\u201d\u9519\u8bef\u3002\u8fd9\u901a\u5e38\u662f\u56e0\u4e3aPython\u672a\u6b63\u786e\u5b89\u88c5\u6216\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u9519\u8bef\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u91cd\u65b0\u5b89\u88c5Python\u6216\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u53e6\u4e00\u4e2a\u5e38\u89c1\u95ee\u9898\u662f\u5728Python Shell\u4e2d\u5bfc\u5165\u6a21\u5757\u65f6\u51fa\u73b0\u201cModuleNotFoundError\u201d\u9519\u8bef\u3002\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a\u6a21\u5757\u672a\u5b89\u88c5\u6216\u5b89\u88c5\u8def\u5f84\u9519\u8bef\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip\u5b89\u88c5\u7f3a\u5931\u7684\u6a21\u5757\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u5982\u679c\u5728Python Shell\u4e2d\u8f93\u5165\u4ee3\u7801\u540e\u6ca1\u6709\u8f93\u51fa\u7ed3\u679c\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u4ee3\u7801\u672a\u6b63\u786e\u6267\u884c\u6216\u8f93\u51fa\u88ab\u91cd\u5b9a\u5411\u3002\u68c0\u67e5\u4ee3\u7801\u7684\u8bed\u6cd5\u548c\u903b\u8f91\uff0c\u786e\u4fdd\u4ee3\u7801\u80fd\u6b63\u786e\u6267\u884c\uff0c\u5e76\u786e\u8ba4\u8f93\u51fa\u672a\u88ab\u91cd\u5b9a\u5411\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001Python Shell\u7684\u6700\u4f73\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u6709\u6548\u5730\u4f7f\u7528Python Shell\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4fdd\u6301\u4ee3\u7801\u7b80\u6d01<\/strong>\uff1a\u5728Python Shell\u4e2d\uff0c\u5c3d\u91cf\u4fdd\u6301\u8f93\u5165\u4ee3\u7801\u7684\u7b80\u6d01\u6027\uff0c\u907f\u514d\u8fc7\u4e8e\u590d\u6742\u7684\u903b\u8f91\u3002\u8fd9\u6837\u53ef\u4ee5\u66f4\u5feb\u5730\u5b9a\u4f4d\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5229\u7528\u547d\u4ee4\u5386\u53f2<\/strong>\uff1a\u5145\u5206\u5229\u7528Python Shell\u7684\u547d\u4ee4\u5386\u53f2\u529f\u80fd\uff0c\u907f\u514d\u91cd\u590d\u8f93\u5165\u76f8\u540c\u7684\u4ee3\u7801\u3002\u8fd9\u53ef\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u5c24\u5176\u662f\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u907f\u514d\u6a21\u5757\u51b2\u7a81\u3002\u5728Python Shell\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u542f\u52a8\uff0c\u786e\u4fdd\u6240\u9700\u7684\u6a21\u5757\u548c\u7248\u672c\u662f\u6b63\u786e\u7684\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bb0\u5f55\u548c\u5907\u4efd<\/strong>\uff1a\u7ecf\u5e38\u8bb0\u5f55\u548c\u5907\u4efd\u5728Python Shell\u4e2d\u6d4b\u8bd5\u7684\u4ee3\u7801\u548c\u7ed3\u679c\u3002\u8fd9\u6837\u53ef\u4ee5\u5728\u9700\u8981\u65f6\u5feb\u901f\u56de\u987e\u548c\u91cd\u7528\u4e4b\u524d\u7684\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b66\u4e60\u548c\u63a2\u7d22<\/strong>\uff1a\u5229\u7528Python Shell\u7684\u4ea4\u4e92\u6027\uff0c\u5c1d\u8bd5\u548c\u5b66\u4e60\u65b0\u7684Python\u7279\u6027\u548c\u6a21\u5757\u3002Python Shell\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u5b9e\u9a8c\u573a\u6240\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u5feb\u5730\u638c\u63e1Python\u6280\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u6700\u4f73\u5b9e\u8df5\uff0c\u4f60\u53ef\u4ee5\u66f4\u52a0\u9ad8\u6548\u5730\u5229\u7528Python Shell\u8fdb\u884c\u5f00\u53d1\u548c\u8c03\u8bd5\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u4e0a\u6253\u5f00Python Shell\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u6253\u5f00Python Shell\u975e\u5e38\u7b80\u5355\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\u627e\u5230Python\u5e94\u7528\u7a0b\u5e8f\uff0c\u70b9\u51fb\u201cIDLE (Python GUI)\u201d\u9009\u9879\u5373\u53ef\u542f\u52a8Python Shell\u3002\u6b64\u5916\uff0c\u82e5\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Anaconda\uff0c\u53ef\u4ee5\u901a\u8fc7Anaconda Navigator\u627e\u5230Jupyter Notebook\u6216Spyder\uff0c\u8fd9\u4e9b\u5de5\u5177\u4e5f\u652f\u6301Python\u7f16\u7a0b\u3002<\/p>\n<p><strong>\u5728Mac\u4e0a\u5982\u4f55\u8bbf\u95eePython Shell\uff1f<\/strong><br \/>\u5bf9\u4e8eMac\u7528\u6237\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\uff08Terminal\uff09\u6765\u6253\u5f00Python Shell\u3002\u53ea\u9700\u6253\u5f00\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u8f93\u5165<code>python3<\/code>\u6216<code>python<\/code>\uff08\u53d6\u51b3\u4e8e\u4f60\u7684\u5b89\u88c5\u7248\u672c\uff09\uff0c\u7136\u540e\u6309\u56de\u8f66\u952e\u5373\u53ef\u3002\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u8fdb\u5165\u4ea4\u4e92\u5f0f\u7684Python\u73af\u5883\uff0c\u76f4\u63a5\u5f00\u59cb\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<p><strong>\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u4f7f\u7528Python Shell\u5417\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u6709\u8bb8\u591a\u5728\u7ebfPython\u7f16\u7a0b\u5e73\u53f0\u5141\u8bb8\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u76f4\u63a5\u4f7f\u7528Python Shell\u3002\u7f51\u7ad9\u5982Replit\u3001Google Colab\u548cJupyter Notebook\u7b49\u63d0\u4f9b\u4e86\u4fbf\u6377\u7684\u73af\u5883\uff0c\u4f60\u53ea\u9700\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u8fd9\u4e9b\u7f51\u7ad9\uff0c\u4fbf\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u800c\u65e0\u9700\u5728\u672c\u5730\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f00\u5934\u6bb5\u843d\uff1a\u6253\u5f00Python Shell\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528Python IDE\u3001\u4f7f\u7528Jupyter N [&hellip;]","protected":false},"author":3,"featured_media":940465,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/940461"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=940461"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/940461\/revisions"}],"predecessor-version":[{"id":940466,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/940461\/revisions\/940466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/940465"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=940461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=940461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=940461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}