{"id":1005199,"date":"2024-12-27T10:33:39","date_gmt":"2024-12-27T02:33:39","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1005199.html"},"modified":"2024-12-27T10:33:43","modified_gmt":"2024-12-27T02:33:43","slug":"%e5%a6%82%e4%bd%95%e4%bf%9d%e5%ad%98%e5%b9%b6%e4%b8%94%e8%bf%90%e8%a1%8cpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1005199.html","title":{"rendered":"\u5982\u4f55\u4fdd\u5b58\u5e76\u4e14\u8fd0\u884cpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081825\/8421a562-d198-421a-bca3-8cebeb3229dc.webp\" alt=\"\u5982\u4f55\u4fdd\u5b58\u5e76\u4e14\u8fd0\u884cpython\" \/><\/p>\n<p><p> <strong>\u8981\u4fdd\u5b58\u5e76\u8fd0\u884cPython\u4ee3\u7801\uff0c\u9996\u5148\u9700\u8981\u4f7f\u7528\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u7f16\u5199\u4ee3\u7801\uff0c\u5c06\u5176\u4fdd\u5b58\u4e3a.py\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528Python\u89e3\u91ca\u5668\u8fd0\u884c\u8be5\u6587\u4ef6\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u3001\u6b63\u786e\u4fdd\u5b58\u6587\u4ef6\u548c\u4f7f\u7528\u9002\u5f53\u547d\u4ee4\u8fd0\u884c\u662f\u5173\u952e\u3002<\/strong>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u4e13\u4e1a\u5efa\u8bae\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u9009\u62e9\u5408\u9002\u7684\u6587\u672c\u7f16\u8f91\u5668\u6216IDE<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u6587\u672c\u7f16\u8f91\u5668\u6216IDE\u662f\u7f16\u5199\u548c\u4fdd\u5b58Python\u4ee3\u7801\u7684\u7b2c\u4e00\u6b65\u3002\u5e02\u9762\u4e0a\u6709\u5f88\u591a\u9009\u9879\u53ef\u4f9b\u9009\u62e9\uff0c\u6bcf\u79cd\u5de5\u5177\u90fd\u6709\u81ea\u5df1\u7684\u4f18\u52bf\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6587\u672c\u7f16\u8f91\u5668<\/strong><\/p>\n<\/p>\n<p><p>\u9009\u62e9\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\u6765\u7f16\u5199Python\u4ee3\u7801\u662f\u4e00\u4e2a\u7b80\u5355\u800c\u76f4\u63a5\u7684\u9009\u62e9\u3002\u63a8\u8350\u4f7f\u7528\u7684\u6587\u672c\u7f16\u8f91\u5668\u5305\u62ec\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>Notepad++<\/strong>\uff1a\u8fd9\u662fWindows\u7528\u6237\u7684\u4e00\u4e2a\u7ecf\u5178\u9009\u62e9\uff0c\u652f\u6301\u8bed\u6cd5\u9ad8\u4eae\u548c\u7b80\u5355\u7684\u4ee3\u7801\u7ba1\u7406\u529f\u80fd\u3002<\/li>\n<li><strong>Sublime Text<\/strong>\uff1a\u8de8\u5e73\u53f0\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u5927\u91cf\u63d2\u4ef6\uff0c\u9002\u5408\u8f7b\u91cf\u7ea7\u5f00\u53d1\u3002<\/li>\n<li><strong>Visual Studio Code<\/strong>\uff1a\u5fae\u8f6f\u63a8\u51fa\u7684\u5f00\u6e90\u7f16\u8f91\u5668\uff0c\u652f\u6301\u4e30\u5bcc\u7684\u63d2\u4ef6\u548c\u6269\u5c55\u529f\u80fd\u3002<\/li>\n<\/ul>\n<p><p>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7684\u4f18\u70b9\u662f\u7b80\u5355\u8f7b\u4fbf\uff0c\u4f46\u7f3a\u70b9\u662f\u7f3a\u5c11\u96c6\u6210\u5f00\u53d1\u73af\u5883\u6240\u63d0\u4f9b\u7684\u9ad8\u7ea7\u529f\u80fd\uff0c\u4f8b\u5982\u4ee3\u7801\u8c03\u8bd5\u548c\u81ea\u52a8\u8865\u5168\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u9700\u8981\u66f4\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u9009\u62e9\u4e00\u4e2aIDE\u3002\u63a8\u8350\u7684IDE\u5305\u62ec\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>PyCharm<\/strong>\uff1a\u7531JetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u5f00\u53d1\u7684\u4e13\u4e1aPython IDE\uff0c\u652f\u6301\u4ee3\u7801\u8c03\u8bd5\u3001\u6d4b\u8bd5\u548c\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\u3002<\/li>\n<li><strong>Eclipse + PyDev<\/strong>\uff1aEclipse\u662f\u4e00\u6b3e\u5f3a\u5927\u7684IDE\uff0c\u901a\u8fc7\u5b89\u88c5PyDev\u63d2\u4ef6\u53ef\u4ee5\u652f\u6301Python\u5f00\u53d1\u3002<\/li>\n<li><strong>Jupyter Notebook<\/strong>\uff1a\u4e3b\u8981\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\uff0c\u652f\u6301\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/li>\n<\/ul>\n<p><p>IDE\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u9002\u5408\u9700\u8981\u8fdb\u884c\u5927\u89c4\u6a21\u9879\u76ee\u5f00\u53d1\u6216\u9700\u8981\u8c03\u8bd5\u4ee3\u7801\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u7f16\u5199\u548c\u4fdd\u5b58Python\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u4e86\u5408\u9002\u7684\u5de5\u5177\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u7f16\u5199\u548c\u4fdd\u5b58Python\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00\u4f60\u9009\u62e9\u7684\u6587\u672c\u7f16\u8f91\u5668\u6216IDE\uff0c\u5e76\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u3002\u5728\u6587\u4ef6\u4e2d\u7f16\u5199\u4f60\u7684Python\u4ee3\u7801\u3002\u786e\u4fdd\u4ee3\u7801\u683c\u5f0f\u6b63\u786e\uff0cPython\u5bf9\u7f29\u8fdb\u8981\u6c42\u4e25\u683c\uff0c\u56e0\u6b64\u4f7f\u7528\u7a7a\u683c\u6216Tab\u8fdb\u884c\u4e00\u81f4\u7684\u7f29\u8fdb\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u5c06\u4f60\u7684\u4ee3\u7801\u6587\u4ef6\u4fdd\u5b58\u4e3a\u4e00\u4e2a.py\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7f16\u5199\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u201cHello, World!\u201d\u7a0b\u5e8f\uff0c\u4f60\u53ef\u4ee5\u5c06\u5176\u4fdd\u5b58\u4e3a<code>hello.py<\/code>\u3002\u4fdd\u5b58\u65f6\uff0c\u786e\u4fdd\u9009\u62e9\u6b63\u786e\u7684\u6587\u4ef6\u683c\u5f0f\u548c\u7f16\u7801\uff08\u901a\u5e38\u4e3aUTF-8\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u8fd0\u884cPython\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u4fdd\u5b58\u597d\u4ee3\u7801\u540e\uff0c\u5c31\u53ef\u4ee5\u8fd0\u884c\u5b83\u4e86\u3002\u8fd0\u884cPython\u4ee3\u7801\u7684\u65b9\u5f0f\u53d6\u51b3\u4e8e\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u6240\u7528\u7684\u5f00\u53d1\u5de5\u5177\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8fd0\u884c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>Windows<\/strong>\uff1a\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u4fdd\u5b58.py\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165<code>python filename.py<\/code>\u8fd0\u884c\u4ee3\u7801\uff08\u5047\u8bbePython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86\u73af\u5883\u53d8\u91cf\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>macOS\/Linux<\/strong>\uff1a\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u6587\u4ef6\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165<code>python3 filename.py<\/code>\u8fd0\u884c\u4ee3\u7801\uff08macOS\u548c\u5927\u591a\u6570Linux\u7cfb\u7edf\u9ed8\u8ba4Python 3\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5728IDE\u4e2d\u8fd0\u884c<\/strong><\/p>\n<\/p>\n<p><p>\u5927\u591a\u6570IDE\u90fd\u63d0\u4f9b\u4e86\u8fd0\u884c\u4ee3\u7801\u7684\u6309\u94ae\u6216\u5feb\u6377\u952e\u3002\u5728PyCharm\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u6216\u8005\u4f7f\u7528Shift + F10\u6765\u8fd0\u884c\u5f53\u524d\u4ee3\u7801\u3002\u5728Jupyter Notebook\u4e2d\uff0c\u76f4\u63a5\u5728\u5355\u5143\u683c\u4e2d\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u8fd0\u884c\u7ed3\u679c<\/strong><\/p>\n<\/p>\n<p><p>\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u68c0\u67e5\u8f93\u51fa\u7ed3\u679c\u3002\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\uff0c\u8f93\u51fa\u4f1a\u663e\u793a\u5728\u7a97\u53e3\u4e2d\u3002\u5728IDE\u4e2d\uff0c\u901a\u5e38\u4f1a\u6709\u4e00\u4e2a\u4e13\u7528\u7684\u63a7\u5236\u53f0\u7a97\u53e3\u663e\u793a\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<p><p>\u5728\u4fdd\u5b58\u548c\u8fd0\u884cPython\u4ee3\u7801\u65f6\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u7684\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u672a\u5b89\u88c5\u6216\u8def\u5f84\u672a\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u8fd0\u884c\u4ee3\u7801\u65f6\u63d0\u793a\u627e\u4e0d\u5230Python\uff0c\u9996\u5148\u786e\u8ba4Python\u662f\u5426\u5df2\u5b89\u88c5\u3002\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u67e5\u770b\u5b89\u88c5\u60c5\u51b5\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u8bbf\u95eePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u65f6\u6ce8\u610f\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u7801\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u65f6\uff0c\u82e5\u51fa\u73b0\u7f16\u7801\u9519\u8bef\uff0c\u786e\u4fdd\u6587\u4ef6\u4f7f\u7528UTF-8\u7f16\u7801\u4fdd\u5b58\uff0c\u8fd9\u901a\u5e38\u662f\u9ed8\u8ba4\u9009\u9879\u3002\u5982\u679c\u9700\u8981\uff0c\u53ef\u4ee5\u5728\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u624b\u52a8\u8bbe\u7f6e\u7f16\u7801\u683c\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bed\u6cd5\u9519\u8bef<\/strong><\/p>\n<\/p>\n<p><p>Python\u5bf9\u7f29\u8fdb\u8981\u6c42\u4e25\u683c\uff0c\u8bed\u6cd5\u9519\u8bef\u901a\u5e38\u7531\u4e0d\u6b63\u786e\u7684\u7f29\u8fdb\u5f15\u8d77\u3002\u4ed4\u7ec6\u68c0\u67e5\u4ee3\u7801\uff0c\u786e\u4fdd\u7f29\u8fdb\u4e00\u81f4\u4e14\u8bed\u6cd5\u6b63\u786e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5e93\u4f9d\u8d56\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4ee3\u7801\u4e2d\u4f7f\u7528\u4e86\u5916\u90e8\u5e93\uff0c\u8bf7\u786e\u4fdd\u5df2\u5728\u73af\u5883\u4e2d\u5b89\u88c5\u8fd9\u4e9b\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528<code>pip install library_name<\/code>\u547d\u4ee4\u6765\u5b89\u88c5\u6240\u9700\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u63d0\u9ad8\u4ee3\u7801\u7f16\u5199\u548c\u8fd0\u884c\u6548\u7387\u7684\u5efa\u8bae<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u7248\u672c\u63a7\u5236<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Git\u7b49\u7248\u672c\u63a7\u5236\u5de5\u5177\u6765\u7ba1\u7406\u4ee3\u7801\u7248\u672c\uff0c\u53ef\u4ee5\u8ddf\u8e2a\u4ee3\u7801\u66f4\u6539\u5e76\u5728\u5fc5\u8981\u65f6\u56de\u6eda\u5230\u4ee5\u524d\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b66\u4e60\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177<\/strong><\/p>\n<\/p>\n<p><p>IDE\u901a\u5e38\u63d0\u4f9b\u5f3a\u5927\u7684\u8c03\u8bd5\u5de5\u5177\uff0c\u5b66\u4f1a\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5feb\u901f\u5b9a\u4f4d\u548c\u89e3\u51b3\u4ee3\u7801\u4e2d\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9a\u671f\u66f4\u65b0Python\u548c\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u4fdd\u6301Python\u89e3\u91ca\u5668\u548c\u4f9d\u8d56\u5e93\u7684\u66f4\u65b0\uff0c\u786e\u4fdd\u4f7f\u7528\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u6ce8\u91ca\u548c\u6587\u6863<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4ee3\u7801\u4e2d\u7f16\u5199\u6ce8\u91ca\u548c\u6587\u6863\uff0c\u5e2e\u52a9\u81ea\u5df1\u548c\u4ed6\u4eba\u7406\u89e3\u4ee3\u7801\u903b\u8f91\u548c\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u548c\u5efa\u8bae\uff0c\u4f60\u53ef\u4ee5\u6709\u6548\u5730\u4fdd\u5b58\u5e76\u8fd0\u884cPython\u4ee3\u7801\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u5e76\u51cf\u5c11\u51fa\u9519\u51e0\u7387\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u5c06\u8ba9\u4f60\u7684\u7f16\u7a0b\u8fc7\u7a0b\u66f4\u52a0\u987a\u7545\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u672c\u5730\u4fdd\u5b58Python\u4ee3\u7801\uff1f<\/strong><br \/>\u4e3a\u4e86\u5728\u672c\u5730\u4fdd\u5b58Python\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad\u3001Sublime Text\u6216VS Code\uff09\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff0c\u4f8b\u5982PyCharm\u6216Jupyter Notebook\uff09\u3002\u5c06\u4ee3\u7801\u7c98\u8d34\u5230\u7f16\u8f91\u5668\u4e2d\u540e\uff0c\u9009\u62e9\u201c\u53e6\u5b58\u4e3a\u201d\uff0c\u786e\u4fdd\u6587\u4ef6\u6269\u5c55\u540d\u4e3a\u201c.py\u201d\u3002\u8fd9\u6837\uff0c\u60a8\u7684\u4ee3\u7801\u5c31\u4f1a\u4ee5Python\u811a\u672c\u7684\u5f62\u5f0f\u4fdd\u5b58\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\uff08Windows\u7528\u6237\u53ef\u4ee5\u4f7f\u7528cmd\u6216PowerShell\uff0cMac\u548cLinux\u7528\u6237\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\uff09\u3002\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u4fdd\u5b58\u811a\u672c\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165<code>python \u6587\u4ef6\u540d.py<\/code>\uff08\u4f8b\u5982\uff0c<code>python myscript.py<\/code>\uff09\u6765\u6267\u884c\u4ee3\u7801\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fPython 3\uff0c\u53ef\u80fd\u9700\u8981\u8f93\u5165<code>python3 \u6587\u4ef6\u540d.py<\/code>\u3002<\/p>\n<p><strong>\u5982\u4f55\u8c03\u8bd5Python\u4ee3\u7801\u4ee5\u786e\u4fdd\u5176\u6b63\u5e38\u8fd0\u884c\uff1f<\/strong><br \/>\u8c03\u8bd5Python\u4ee3\u7801\u7684\u6709\u6548\u65b9\u6cd5\u662f\u4f7f\u7528\u5185\u7f6e\u7684\u8c03\u8bd5\u5668\uff08\u5982pdb\uff09\u6216\u8005\u5728IDE\u4e2d\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\u3002\u60a8\u8fd8\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u63d2\u5165\u6253\u5370\u8bed\u53e5\uff0c\u4ee5\u4fbf\u8ddf\u8e2a\u53d8\u91cf\u7684\u503c\u548c\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u5f02\u5e38\u5904\u7406\uff08try-except\u5757\uff09\u53ef\u4ee5\u5e2e\u52a9\u6355\u6349\u548c\u5904\u7406\u9519\u8bef\uff0c\u4ece\u800c\u907f\u514d\u7a0b\u5e8f\u5d29\u6e83\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u4fdd\u5b58\u5e76\u8fd0\u884cPython\u4ee3\u7801\uff0c\u9996\u5148\u9700\u8981\u4f7f\u7528\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u7f16\u5199\u4ee3\u7801\uff0c\u5c06\u5176\u4fdd\u5b58\u4e3a.py\u6587 [&hellip;]","protected":false},"author":3,"featured_media":1005206,"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\/1005199"}],"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=1005199"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1005199\/revisions"}],"predecessor-version":[{"id":1005208,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1005199\/revisions\/1005208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1005206"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1005199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1005199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1005199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}