{"id":1004804,"date":"2024-12-27T10:29:49","date_gmt":"2024-12-27T02:29:49","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1004804.html"},"modified":"2024-12-27T10:29:52","modified_gmt":"2024-12-27T02:29:52","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8python%e8%bf%90%e8%a1%8c%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1004804.html","title":{"rendered":"\u5982\u4f55\u5728python\u8fd0\u884c\u4ee3\u7801"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081607\/c1481c1b-7685-4cea-a234-0be09f0eaaf4.webp\" alt=\"\u5982\u4f55\u5728python\u8fd0\u884c\u4ee3\u7801\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u8fd0\u884c\u4ee3\u7801\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec<strong>\u4f7f\u7528Python\u89e3\u91ca\u5668\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u548c\u5728\u7ebf\u7f16\u8bd1\u5668<\/strong>\u3002\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662f\u4f7f\u7528Python\u89e3\u91ca\u5668\u548cIDE\u3002Python\u89e3\u91ca\u5668\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c\uff0c\u800cIDE\u5219\u63d0\u4f9b\u4e86\u66f4\u4e3a\u4fbf\u6377\u7684\u56fe\u5f62\u5316\u754c\u9762\u3002<strong>\u9009\u62e9\u9002\u5408\u81ea\u5df1\u4e60\u60ef\u548c\u9700\u6c42\u7684\u5de5\u5177\u662f\u9ad8\u6548\u8fd0\u884cPython\u4ee3\u7801\u7684\u5173\u952e<\/strong>\u3002\u4e0b\u9762\u5c06\u5bf9\u5176\u4e2d\u7684\u4e00\u79cd\u65b9\u6cd5\u8fdb\u884c\u8be6\u7ec6\u63cf\u8ff0\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528Python\u89e3\u91ca\u5668<\/strong>\u662f\u6700\u57fa\u7840\u4e14\u76f4\u63a5\u7684\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u9700\u8981\u786e\u4fdd\u5728\u8ba1\u7b97\u673a\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002\u5b89\u88c5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8fdb\u5165Python\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\uff0c\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u83b7\u5f97\u53cd\u9988\uff0c\u8fd9\u662fPython\u7684\u5f3a\u5927\u4e4b\u5904\u4e4b\u4e00\u3002\u5bf9\u4e8e\u590d\u6742\u7684\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5c06\u4ee3\u7801\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c\uff0c\u4f8b\u5982<code>python script.py<\/code>\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u4f7f\u7528PYTHON\u89e3\u91ca\u5668<\/h3>\n<\/p>\n<p><p>Python\u89e3\u91ca\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u76f4\u63a5\u4e14\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u8fd0\u884cPython\u4ee3\u7801\u3002\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165Python\u547d\u4ee4\u5e76\u7acb\u5373\u6267\u884c\u3002<\/p>\n<\/p>\n<p><h4>1.1 \u5b89\u88c5Python<\/h4>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u4ee3\u7801\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u3002Python\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86\u9002\u7528\u4e8eWindows\u3001macOS\u548cLinux\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u4e0b\u8f7d\u5e76\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u9a8c\u8bc1Python\u662f\u5426\u6210\u529f\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u8f93\u5165\u547d\u4ee4 <code>python --version<\/code> \u6216 <code>python3 --version<\/code>\u3002<\/li>\n<li>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u60a8\u5c06\u770b\u5230Python\u7684\u7248\u672c\u53f7\u3002<\/li>\n<\/ul>\n<p><h4>1.2 \u8fd0\u884cPython\u4ea4\u4e92\u5f0f\u73af\u5883<\/h4>\n<\/p>\n<p><p>Python\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\u5141\u8bb8\u7528\u6237\u76f4\u63a5\u8f93\u5165\u5e76\u6267\u884cPython\u4ee3\u7801\u3002\u8fd9\u5bf9\u4e8e\u6d4b\u8bd5\u5c0f\u6bb5\u4ee3\u7801\u6216\u5b66\u4e60Python\u975e\u5e38\u6709\u7528\u3002\u542f\u52a8\u4ea4\u4e92\u5f0f\u73af\u5883\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165 <code>python<\/code> \u6216 <code>python3<\/code>\u3002<\/li>\n<li>\u60a8\u5c06\u770b\u5230\u4e00\u4e2aPython\u63d0\u793a\u7b26 <code>&gt;&gt;&gt;<\/code>\uff0c\u8868\u793a\u53ef\u4ee5\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u8f93\u5165\u4ee3\u7801\u540e\u6309\u4e0bEnter\u952e\uff0c\u5373\u53ef\u770b\u5230\u6267\u884c\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><h4>1.3 \u8fd0\u884cPython\u811a\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u7a0b\u5e8f\uff0c\u901a\u5e38\u5c06\u4ee3\u7801\u5199\u5165\u811a\u672c\u6587\u4ef6\u4e2d\u5e76\u8fd0\u884c\u6574\u4e2a\u6587\u4ef6\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad++\u3001Sublime Text\u6216VSCode\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3a <code>script.py<\/code>\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<li>\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165\u547d\u4ee4 <code>python script.py<\/code> \u6216 <code>python3 script.py<\/code> \u4ee5\u8fd0\u884c\u811a\u672c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><p>IDE\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684\u5f00\u53d1\u73af\u5883\uff0c\u5305\u542b\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u548c\u8fd0\u884c\u529f\u80fd\u3002\u5728Python\u5f00\u53d1\u4e2d\uff0c\u5e38\u7528\u7684IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u548cJupyter Notebook\u3002<\/p>\n<\/p>\n<p><h4>2.1 PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684Python IDE\uff0c\u63d0\u4f9b\u4e86\u667a\u80fd\u4ee3\u7801\u8865\u5168\u3001\u4ee3\u7801\u5bfc\u822a\u548c\u8c03\u8bd5\u5de5\u5177\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u4e2d\u521b\u5efa\u4e00\u4e2aPython\u6587\u4ef6\uff0c\u5e76\u8f93\u5165\u4ee3\u7801\u3002<\/li>\n<li>\u4f7f\u7528PyCharm\u7684\u8fd0\u884c\u6309\u94ae\u6267\u884c\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h4>2.2 Visual Studio Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5Visual Studio Code\u548cPython\u6269\u5c55\u3002<\/li>\n<li>\u6253\u5f00\u4e00\u4e2aPython\u6587\u4ef6\u6216\u521b\u5efa\u65b0\u7684Python\u6587\u4ef6\u3002<\/li>\n<li>\u4f7f\u7528\u5185\u7f6e\u7ec8\u7aef\u6216\u6269\u5c55\u4e2d\u7684\u8fd0\u884c\u547d\u4ee4\u6765\u6267\u884cPython\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h4>2.3 Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u5206\u6790\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5Jupyter Notebook\uff08\u901a\u5e38\u901a\u8fc7Anaconda\uff09\u3002<\/li>\n<li>\u542f\u52a8Jupyter Notebook\u670d\u52a1\u5668\uff0c\u5e76\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00Notebook\u754c\u9762\u3002<\/li>\n<li>\u521b\u5efa\u65b0\u7684Notebook\u5355\u5143\u683c\u5e76\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u8fd0\u884c\u5355\u5143\u683c\u4ee5\u67e5\u770b\u8f93\u51fa\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5728\u7ebf\u7f16\u8bd1\u5668<\/h3>\n<\/p>\n<p><p>\u5728\u7ebf\u7f16\u8bd1\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u65e0\u9700\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6\u5373\u53ef\u8fd0\u884cPython\u4ee3\u7801\u7684\u4fbf\u6377\u65b9\u5f0f\u3002\u8fd9\u5bf9\u4e8e\u5feb\u901f\u6d4b\u8bd5\u4ee3\u7801\u7247\u6bb5\u6216\u5728\u6ca1\u6709\u5f00\u53d1\u73af\u5883\u7684\u8bbe\u5907\u4e0a\u8fd0\u884c\u4ee3\u7801\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h4>3.1 Repl.it<\/h4>\n<\/p>\n<p><p>Repl.it\u662f\u4e00\u4e2a\u652f\u6301\u591a\u79cd\u8bed\u8a00\u7684\u5728\u7ebf\u7f16\u7a0b\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u7c7b\u4f3cIDE\u7684\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eeRepl.it\u7f51\u7ad9\u3002<\/li>\n<li>\u9009\u62e9Python\u4f5c\u4e3a\u7f16\u7a0b\u8bed\u8a00\u3002<\/li>\n<li>\u8f93\u5165Python\u4ee3\u7801\u5e76\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><h4>3.2 Google Colab<\/h4>\n<\/p>\n<p><p>Google Colab\u662f\u4e00\u4e2a\u57fa\u4e8eJupyter Notebook\u7684\u5728\u7ebf\u5e73\u53f0\uff0c\u7279\u522b\u9002\u5408\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u5206\u6790\u3002<\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eeGoogle Colab\u7f51\u7ad9\u5e76\u767b\u5f55Google\u8d26\u53f7\u3002<\/li>\n<li>\u521b\u5efa\u65b0\u7684Notebook\u5e76\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u8fd0\u884cNotebook\u5355\u5143\u683c\u67e5\u770b\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001Python\u4ee3\u7801\u8c03\u8bd5\u548c\u4f18\u5316<\/h3>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u8c03\u8bd5\u548c\u4f18\u5316\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u6b65\u9aa4\uff0c\u4ee5\u786e\u4fdd\u4ee3\u7801\u7684\u6b63\u786e\u6027\u548c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>4.1 \u4f7f\u7528\u8c03\u8bd5\u5668<\/h4>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u8c03\u8bd5\u5de5\u5177\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u8bc6\u522b\u548c\u4fee\u590d\u9519\u8bef\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528Python\u5185\u7f6e\u7684<code>pdb<\/code>\u8c03\u8bd5\u5668\u8fdb\u884c\u547d\u4ee4\u884c\u8c03\u8bd5\u3002<\/li>\n<li>\u5728IDE\u4e2d\u4f7f\u7528\u53ef\u89c6\u5316\u8c03\u8bd5\u5de5\u5177\uff0c\u5982PyCharm\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u8bbe\u7f6e\u65ad\u70b9\u5e76\u9010\u6b65\u6267\u884c\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h4>4.2 \u4ee3\u7801\u4f18\u5316<\/h4>\n<\/p>\n<p><p>\u4f18\u5316Python\u4ee3\u7801\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u5927\u6570\u636e\u6216\u6267\u884c\u590d\u6742\u8ba1\u7b97\u65f6\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u548c\u5e93\uff0c\u5982<code>itertools<\/code>\u548c<code>collections<\/code>\uff0c\u4ee5\u63d0\u9ad8\u4ee3\u7801\u6548\u7387\u3002<\/li>\n<li>\u901a\u8fc7\u5206\u6790\u4ee3\u7801\u74f6\u9888\uff0c\u4f7f\u7528\u66f4\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u3002<\/li>\n<li>\u4f7f\u7528\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\u6280\u672f\u6765\u52a0\u901f\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001Python\u4ee3\u7801\u7684\u7248\u672c\u63a7\u5236<\/h3>\n<\/p>\n<p><p>\u7248\u672c\u63a7\u5236\u662f\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u91cd\u8981\u90e8\u5206\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u8ddf\u8e2a\u4ee3\u7801\u7684\u66f4\u6539\u5e76\u534f\u540c\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>5.1 \u4f7f\u7528Git<\/h4>\n<\/p>\n<p><p>Git\u662f\u6700\u6d41\u884c\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5e7f\u6cdb\u7528\u4e8e\u7ba1\u7406\u4ee3\u7801\u5e93\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5Git\u5e76\u914d\u7f6e\u7528\u6237\u4fe1\u606f\u3002<\/li>\n<li>\u5728\u672c\u5730\u9879\u76ee\u76ee\u5f55\u4e2d\u521d\u59cb\u5316Git\u4ed3\u5e93\u3002<\/li>\n<li>\u4f7f\u7528<code>git add<\/code>\u3001<code>git commit<\/code>\u548c<code>git push<\/code>\u547d\u4ee4\u6765\u7ba1\u7406\u4ee3\u7801\u66f4\u6539\u3002<\/li>\n<\/ul>\n<p><h4>5.2 GitHub\u548cGitLab<\/h4>\n<\/p>\n<p><p>GitHub\u548cGitLab\u662f\u6258\u7ba1Git\u4ed3\u5e93\u7684\u5728\u7ebf\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u534f\u4f5c\u5f00\u53d1\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<ul>\n<li>\u521b\u5efaGitHub\u6216GitLab\u8d26\u53f7\u3002<\/li>\n<li>\u5728\u5e73\u53f0\u4e0a\u521b\u5efa\u65b0\u7684\u4ee3\u7801\u4ed3\u5e93\u3002<\/li>\n<li>\u5c06\u672c\u5730Git\u4ed3\u5e93\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u5173\u8054\uff0c\u5e76\u63a8\u9001\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u5b66\u4e60\u5982\u4f55\u5728Python\u4e2d\u8fd0\u884c\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u66f4\u52a0\u9ad8\u6548\u5730\u5f00\u53d1\u548c\u8c03\u8bd5\u7a0b\u5e8f\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u5c06\u6709\u52a9\u4e8e\u63d0\u5347\u60a8\u7684\u7f16\u7a0b\u4f53\u9a8c\u548c\u4ee3\u7801\u8d28\u91cf\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0c\u719f\u7ec3\u638c\u63e1\u8fd0\u884c\u4ee3\u7801\u7684\u57fa\u672c\u6280\u80fd\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u4ee5\u4fbf\u8fd0\u884c\u4ee3\u7801\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u8fd0\u884c\u4ee3\u7801\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u4f60\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001VS Code\u6216Jupyter Notebook\u6765\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\u3002\u786e\u4fdd\u5728IDE\u4e2d\u6b63\u786e\u914d\u7f6ePython\u89e3\u91ca\u5668\uff0c\u4ee5\u4fbf\u987a\u5229\u6267\u884c\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u4ee3\u7801\uff1f<\/strong><br \/>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u5bfc\u822a\u5230\u5305\u542b\u4f60Python\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f7f\u7528\u547d\u4ee4<code>python your_script.py<\/code>\uff08\u66ff\u6362<code>your_script.py<\/code>\u4e3a\u4f60\u7684\u6587\u4ef6\u540d\uff09\u5373\u53ef\u6267\u884c\u8be5\u811a\u672c\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 3\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3 your_script.py<\/code>\u547d\u4ee4\u3002<\/p>\n<p><strong>\u5982\u4f55\u8c03\u8bd5Python\u4ee3\u7801\u4ee5\u786e\u4fdd\u5176\u6b63\u5e38\u8fd0\u884c\uff1f<\/strong><br \/>\u8c03\u8bd5\u662f\u786e\u4fddPython\u4ee3\u7801\u6b63\u5e38\u8fd0\u884c\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u4f7f\u7528IDE\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u9010\u884c\u6267\u884c\u4ee3\u7801\uff0c\u68c0\u67e5\u53d8\u91cf\u72b6\u6001\u548c\u7a0b\u5e8f\u6d41\u3002\u6b64\u5916\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0<code>print()<\/code>\u8bed\u53e5\uff0c\u8f93\u51fa\u53d8\u91cf\u503c\u548c\u72b6\u6001\uff0c\u4ee5\u4fbf\u5728\u63a7\u5236\u53f0\u4e2d\u67e5\u770b\u8fd0\u884c\u7ed3\u679c\u3002\u8fd8\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>pdb<\/code>\u6a21\u5757\u6765\u8bbe\u7f6e\u65ad\u70b9\uff0c\u8fdb\u884c\u66f4\u6df1\u5165\u7684\u8c03\u8bd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8fd0\u884c\u4ee3\u7801\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528Python\u89e3\u91ca\u5668\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u548c\u5728\u7ebf\u7f16\u8bd1\u5668\u3002\u5176\u4e2d\u6700\u5e38 [&hellip;]","protected":false},"author":3,"featured_media":1004809,"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\/1004804"}],"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=1004804"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1004804\/revisions"}],"predecessor-version":[{"id":1004811,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1004804\/revisions\/1004811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1004809"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1004804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1004804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1004804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}