{"id":935050,"date":"2024-12-26T18:45:14","date_gmt":"2024-12-26T10:45:14","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/935050.html"},"modified":"2024-12-26T18:45:16","modified_gmt":"2024-12-26T10:45:16","slug":"vscode%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/935050.html","title":{"rendered":"vscode\u5982\u4f55\u8c03\u7528python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25071847\/5b01206b-8d84-4711-ac33-6a3fd65cdc62.webp\" alt=\"vscode\u5982\u4f55\u8c03\u7528python\" \/><\/p>\n<p><p> <strong>\u5728VSCode\u4e2d\u8c03\u7528Python\u7684\u65b9\u6cd5\u6709\uff1a\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6ePython\u89e3\u91ca\u5668\u3001\u521b\u5efaPython\u6587\u4ef6\u3001\u8fd0\u884cPython\u6587\u4ef6\u3001\u4f7f\u7528\u96c6\u6210\u7ec8\u7aef\u3002<\/strong>\u5176\u4e2d\uff0c\u5b89\u88c5Python\u6269\u5c55\u662f\u6700\u57fa\u7840\u7684\u4e00\u6b65\uff0c\u5b83\u63d0\u4f9b\u4e86\u5bf9Python\u8bed\u8a00\u7684\u652f\u6301\u548c\u5404\u79cd\u529f\u80fd\u3002\u914d\u7f6ePython\u89e3\u91ca\u5668\u662f\u4e3a\u4e86\u786e\u4fdd\u4ee3\u7801\u8fd0\u884c\u5728\u6b63\u786e\u7684Python\u73af\u5883\u4e0b\u3002\u521b\u5efa\u548c\u8fd0\u884cPython\u6587\u4ef6\u662f\u65e5\u5e38\u4f7f\u7528\u4e2d\u7684\u6838\u5fc3\u6b65\u9aa4\uff0c\u800c\u96c6\u6210\u7ec8\u7aef\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8fdb\u884c\u66f4\u590d\u6742\u7684\u4ea4\u4e92\u548c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python\u6269\u5c55<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\uff0cPython\u6269\u5c55\u63d0\u4f9b\u4e86\u5bf9Python\u8bed\u8a00\u7684\u5e7f\u6cdb\u652f\u6301\u3002\u9996\u5148\uff0c\u6253\u5f00VSCode\uff0c\u70b9\u51fb\u5de6\u4fa7\u6d3b\u52a8\u680f\u4e2d\u7684\u6269\u5c55\u56fe\u6807\uff08\u901a\u5e38\u662f\u4e00\u4e2a\u65b9\u5757\u56fe\u6807\uff09\u3002\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cPython\u201d\uff0c\u7136\u540e\u5b89\u88c5\u7531Microsoft\u63d0\u4f9b\u7684Python\u6269\u5c55\u3002\u8fd9\u4e00\u6269\u5c55\u4f1a\u4e3aVSCode\u589e\u52a0Python\u7684\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u8865\u5168\u3001\u8c03\u8bd5\u652f\u6301\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0cVSCode\u901a\u5e38\u4f1a\u63d0\u793a\u91cd\u542f\u4ee5\u6fc0\u6d3b\u6269\u5c55\u7684\u529f\u80fd\u3002\u6269\u5c55\u5b89\u88c5\u540e\uff0c\u5b83\u8fd8\u4f1a\u81ea\u52a8\u63d0\u793a\u7528\u6237\u5b89\u88c5Python\u89e3\u91ca\u5668\uff0c\u5982\u679c\u7cfb\u7edf\u4e2d\u6ca1\u6709\u5b89\u88c5Python\uff0c\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5Python\u73af\u5883\uff0c\u6bd4\u5982Anaconda\u6216\u76f4\u63a5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u914d\u7f6ePython\u89e3\u91ca\u5668<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u6269\u5c55\u540e\uff0c\u4e0b\u4e00\u6b65\u662f\u914d\u7f6ePython\u89e3\u91ca\u5668\u3002\u70b9\u51fbVSCode\u7a97\u53e3\u5de6\u4e0b\u89d2\u7684Python\u7248\u672c\u53f7\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952eCtrl + Shift + P\uff08Mac\u4e0a\u4e3aCmd + Shift + P\uff09\u6253\u5f00\u547d\u4ee4\u9762\u677f\uff0c\u8f93\u5165\u5e76\u9009\u62e9\u201cPython: Select Interpreter\u201d\u3002\u5728\u5f39\u51fa\u7684\u5217\u8868\u4e2d\u9009\u62e9\u4f60\u60f3\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u6b63\u786e\u7684Python\u89e3\u91ca\u5668\u8def\u5f84\u662f\u786e\u4fddPython\u4ee3\u7801\u80fd\u591f\u5728\u6b63\u786e\u73af\u5883\u4e0b\u8fd0\u884c\u7684\u5173\u952e\u3002\u5982\u679c\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u8bf7\u786e\u4fdd\u5728\u7ec8\u7aef\u4e2d\u6fc0\u6d3b\u8be5\u73af\u5883\uff0c\u8fd9\u6837VSCode\u4f1a\u81ea\u52a8\u4f7f\u7528\u8be5\u73af\u5883\u4e2d\u7684Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u521b\u5efaPython\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\u521b\u5efaPython\u6587\u4ef6\u975e\u5e38\u7b80\u5355\u3002\u5728\u6587\u4ef6\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u65b0\u5efa\u6587\u4ef6\u201d\uff0c\u7136\u540e\u4fdd\u5b58\u6587\u4ef6\u5e76\u786e\u4fdd\u6587\u4ef6\u6269\u5c55\u540d\u4e3a\u201c.py\u201d\u3002\u8fd9\u4f1a\u4f7fVSCode\u81ea\u52a8\u8bc6\u522b\u5e76\u5e94\u7528Python\u6269\u5c55\u63d0\u4f9b\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u521b\u5efaPython\u6587\u4ef6\u540e\uff0c\u7528\u6237\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199Python\u4ee3\u7801\u3002VSCode\u4f1a\u6839\u636ePython\u6269\u5c55\u63d0\u4f9b\u8bed\u6cd5\u9ad8\u4eae\u3001\u81ea\u52a8\u8865\u5168\u548c\u4ee3\u7801\u9519\u8bef\u63d0\u793a\u3002\u8fd9\u4e9b\u529f\u80fd\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7f16\u5199\u548c\u8c03\u8bd5Python\u4ee3\u7801\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u8fd0\u884cPython\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u8981\u5728VSCode\u4e2d\u8fd0\u884cPython\u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u6253\u5f00Python\u6587\u4ef6\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952eF5\u542f\u52a8\u8c03\u8bd5\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u5728\u8c03\u8bd5\u6a21\u5f0f\u4e0b\uff0c\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3001\u9010\u6b65\u6267\u884c\u4ee3\u7801\u3001\u67e5\u770b\u53d8\u91cf\u503c\u7b49\uff0c\u8fd9\u4e9b\u529f\u80fd\u5bf9\u4e8e\u5b9a\u4f4d\u548c\u89e3\u51b3\u4ee3\u7801\u95ee\u9898\u975e\u5e38\u6709\u5e2e\u52a9\u3002\u7528\u6237\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884cPython\u6587\u4ef6\uff0c\u4f7f\u7528\u547d\u4ee4<code>python filename.py<\/code>\uff0c\u5176\u4e2dfilename.py\u662f\u4f60\u7684Python\u6587\u4ef6\u540d\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528\u96c6\u6210\u7ec8\u7aef<\/p>\n<\/p>\n<p><p>VSCode\u7684\u96c6\u6210\u7ec8\u7aef\u63d0\u4f9b\u4e86\u4e0e\u7cfb\u7edf\u7ec8\u7aef\u76f8\u540c\u7684\u529f\u80fd\uff0c\u4f46\u5b83\u76f4\u63a5\u5d4c\u5165\u5728VSCode\u4e2d\uff0c\u4f7f\u7528\u6237\u53ef\u4ee5\u5728\u540c\u4e00\u754c\u9762\u4e2d\u5b8c\u6210\u6240\u6709\u64cd\u4f5c\u3002\u7528\u6237\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u6267\u884cPython\u547d\u4ee4\u3001\u5b89\u88c5Python\u5305\u3001\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u8981\u6253\u5f00\u96c6\u6210\u7ec8\u7aef\uff0c\u53ef\u4ee5\u4f7f\u7528\u5feb\u6377\u952eCtrl + `\uff08\u53cd\u5f15\u53f7\uff09\uff0c\u6216\u8005\u4ece\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u7ec8\u7aef\u201d-&gt;\u201c\u65b0\u7ec8\u7aef\u201d\u3002\u96c6\u6210\u7ec8\u7aef\u652f\u6301\u591a\u79cdshell\u73af\u5883\uff0c\u6bd4\u5982bash\u3001PowerShell\u7b49\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u4e60\u60ef\u8fdb\u884c\u9009\u62e9\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u4f7f\u7528Python\u6269\u5c55\u529f\u80fd<\/p>\n<\/p>\n<p><p>Python\u6269\u5c55\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u4ee3\u7801\u8fd0\u884c\u548c\u8c03\u8bd5\u529f\u80fd\uff0c\u8fd8\u5305\u62ecLinting\u3001\u683c\u5f0f\u5316\u3001\u5355\u5143\u6d4b\u8bd5\u652f\u6301\u7b49\u3002Linting\u662f\u6307\u4ee3\u7801\u68c0\u67e5\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5728\u7f16\u5199\u4ee3\u7801\u65f6\u53d1\u73b0\u6f5c\u5728\u7684\u9519\u8bef\u548c\u4e0d\u89c4\u8303\u3002VSCode\u652f\u6301\u591a\u79cdLinting\u5de5\u5177\uff0c\u5982PyLint\u3001Flake8\u7b49\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><p>\u683c\u5f0f\u5316\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u4fdd\u6301\u4ee3\u7801\u98ce\u683c\u4e00\u81f4\uff0cVSCode\u652f\u6301Black\u3001autopep8\u7b49\u683c\u5f0f\u5316\u5de5\u5177\u3002\u5728Python\u6269\u5c55\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u914d\u7f6e\u8fd9\u4e9b\u5de5\u5177\u7684\u4f7f\u7528\u65b9\u5f0f\u548c\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u7ba1\u7406Python\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\uff0c\u7ba1\u7406Python\u73af\u5883\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u4f7f\u7528Python\u6269\u5c55\u63d0\u4f9b\u7684\u547d\u4ee4\u6765\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u73af\u5883\u3002\u865a\u62df\u73af\u5883\u53ef\u4ee5\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\uff0c\u907f\u514d\u51b2\u7a81\u3002<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u9762\u677f\u8f93\u5165\u201cPython: Create Environment\u201d\u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\u3002\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528venv\u6216Conda\u6765\u521b\u5efa\u73af\u5883\uff0c\u5e76\u6839\u636e\u9879\u76ee\u9700\u6c42\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u5305\u3002<\/p>\n<\/p>\n<p><p>\u516b\u3001\u4f7f\u7528Jupyter Notebook<\/p>\n<\/p>\n<p><p>VSCode\u652f\u6301Jupyter Notebook\uff0c\u901a\u8fc7\u5b89\u88c5Jupyter\u6269\u5c55\uff0c\u7528\u6237\u53ef\u4ee5\u5728VSCode\u4e2d\u76f4\u63a5\u8fd0\u884c\u548c\u7f16\u8f91.ipynb\u6587\u4ef6\u3002Jupyter Notebook\u662f\u4e00\u79cd\u4ea4\u4e92\u5f0f\u6587\u6863\u683c\u5f0f\uff0c\u5e7f\u6cdb\u7528\u4e8e\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<p><p>\u5728VSCode\u4e2d\u6253\u5f00.ipynb\u6587\u4ef6\u540e\uff0c\u7528\u6237\u53ef\u4ee5\u50cf\u5728Jupyter Notebook\u4e2d\u4e00\u6837\u8fd0\u884c\u5355\u5143\u683c\u3001\u67e5\u770b\u8f93\u51fa\u3001\u63d2\u5165Markdown\u6587\u672c\u7b49\u3002VSCode\u63d0\u4f9b\u7684Jupyter\u652f\u6301\u4e0ePython\u6269\u5c55\u7d27\u5bc6\u96c6\u6210\uff0c\u4f7f\u5f97\u6570\u636e\u79d1\u5b66\u5bb6\u7684\u5de5\u4f5c\u6d41\u7a0b\u66f4\u52a0\u6d41\u7545\u3002<\/p>\n<\/p>\n<p><p>\u4e5d\u3001\u914d\u7f6e\u8c03\u8bd5\u529f\u80fd<\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u662f\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u91cd\u8981\u73af\u8282\uff0cVSCode\u4e3aPython\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u5728\u4ee3\u7801\u884c\u5de6\u4fa7\u70b9\u51fb\u8bbe\u7f6e\u65ad\u70b9\uff0c\u7136\u540e\u4f7f\u7528F5\u5f00\u59cb\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u5668\u53ef\u4ee5\u8ba9\u7528\u6237\u9010\u6b65\u6267\u884c\u4ee3\u7801\u3001\u67e5\u770b\u5f53\u524d\u4f5c\u7528\u57df\u4e2d\u7684\u53d8\u91cf\u3001\u8c03\u7528\u5806\u6808\u4fe1\u606f\u7b49\u3002\u7528\u6237\u8fd8\u53ef\u4ee5\u901a\u8fc7launch.json\u6587\u4ef6\u8fdb\u884c\u9ad8\u7ea7\u8c03\u8bd5\u914d\u7f6e\uff0c\u6bd4\u5982\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u5341\u3001\u4f7f\u7528Git\u8fdb\u884c\u7248\u672c\u63a7\u5236<\/p>\n<\/p>\n<p><p>VSCode\u5185\u7f6e\u4e86Git\u652f\u6301\uff0c\u7528\u6237\u53ef\u4ee5\u5728VSCode\u4e2d\u76f4\u63a5\u8fdb\u884c\u7248\u672c\u63a7\u5236\u64cd\u4f5c\u3002Python\u5f00\u53d1\u4e2d\uff0c\u4f7f\u7528Git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u662f\u6700\u4f73\u5b9e\u8df5\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6e90\u4ee3\u7801\u7ba1\u7406\u89c6\u56fe\u67e5\u770b\u6587\u4ef6\u53d8\u66f4\u3001\u63d0\u4ea4\u4ee3\u7801\u3001\u521b\u5efa\u5206\u652f\u7b49\u3002VSCode\u8fd8\u652f\u6301GitHub\u3001GitLab\u7b49\u5e73\u53f0\u7684\u76f4\u63a5\u96c6\u6210\uff0c\u7528\u6237\u53ef\u4ee5\u5728VSCode\u4e2d\u5b8c\u6210\u4ee3\u7801\u7684\u63d0\u4ea4\u548c\u62c9\u53d6\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><p>\u5341\u4e00\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\u8c03\u7528Python\u6d89\u53ca\u5230\u591a\u4e2a\u6b65\u9aa4\u548c\u529f\u80fd\uff0c\u4f46\u53ea\u8981\u719f\u6089\u6bcf\u4e00\u4e2a\u73af\u8282\uff0c\u7528\u6237\u5c31\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684Python\u5f00\u53d1\u73af\u5883\u3002\u901a\u8fc7\u5b89\u88c5\u548c\u914d\u7f6ePython\u6269\u5c55\u3001\u4f7f\u7528\u96c6\u6210\u7ec8\u7aef\u3001\u7ba1\u7406Python\u73af\u5883\u3001\u8c03\u8bd5\u4ee3\u7801\u7b49\uff0cVSCode\u4e3aPython\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u5e73\u53f0\u3002\u901a\u8fc7\u8fd9\u4e9b\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u7f16\u5199\u3001\u8c03\u8bd5\u548c\u7ba1\u7406Python\u9879\u76ee\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728VSCode\u4e2d\u8bbe\u7f6ePython\u5f00\u53d1\u73af\u5883\uff1f<\/strong><br \/>\u5728VSCode\u4e2d\u8bbe\u7f6ePython\u5f00\u53d1\u73af\u5883\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff0c\u5e76\u4e14\u5728\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u6dfb\u52a0\u4e86Python\u7684\u8def\u5f84\u3002\u63a5\u4e0b\u6765\uff0c\u6253\u5f00VSCode\uff0c\u5b89\u88c5Python\u6269\u5c55\u63d2\u4ef6\uff0c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5de6\u4fa7\u7684\u6269\u5c55\u56fe\u6807\u641c\u7d22\u201cPython\u201d\u627e\u5230\u5e76\u5b89\u88c5\u3002\u5728\u5b89\u88c5\u5b8c\u63d2\u4ef6\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u4e00\u4e2aPython\u6587\u4ef6\uff0cVSCode\u4f1a\u81ea\u52a8\u8bc6\u522b\u5e76\u63d0\u793a\u60a8\u9009\u62e9\u89e3\u91ca\u5668\u3002\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u4e86\u3002<\/p>\n<p><strong>VSCode\u4e2d\u5982\u4f55\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728VSCode\u4e2d\u8fd0\u884cPython\u811a\u672c\u6709\u51e0\u79cd\u65b9\u6cd5\u3002\u60a8\u53ef\u4ee5\u5728\u7f16\u8f91\u5668\u4e2d\u6253\u5f00\u60a8\u7684Python\u6587\u4ef6\uff0c\u7136\u540e\u901a\u8fc7\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u6587\u4ef6\u201d\u6765\u6267\u884c\u811a\u672c\u3002\u6b64\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5feb\u6377\u952e\u201cCtrl + Shift + P\u201d\u6253\u5f00\u547d\u4ee4\u9762\u677f\uff0c\u8f93\u5165\u201cRun Python File in Terminal\u201d\u5e76\u9009\u62e9\u6267\u884c\u3002\u53e6\u4e00\u79cd\u65b9\u5f0f\u662f\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python \u6587\u4ef6\u540d.py<\/code>\u6765\u8fd0\u884c\u60a8\u7684\u811a\u672c\u3002<\/p>\n<p><strong>\u5982\u4f55\u8c03\u8bd5Python\u4ee3\u7801\uff1f<\/strong><br \/>\u5728VSCode\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\u975e\u5e38\u65b9\u4fbf\u3002\u60a8\u9700\u8981\u5148\u8bbe\u7f6e\u4e00\u4e2a\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u5728\u60a8\u7684\u5de5\u4f5c\u533a\u4e2d\u521b\u5efa\u4e00\u4e2a<code>.vscode<\/code>\u6587\u4ef6\u5939\uff0c\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0<code>launch.json<\/code>\u6587\u4ef6\u3002\u5728\u8be5\u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u8c03\u8bd5\u7684\u7a0b\u5e8f\u8def\u5f84\u548c\u5176\u4ed6\u53c2\u6570\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u65ad\u70b9\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684\u8c03\u8bd5\u56fe\u6807\uff0c\u9009\u62e9\u76f8\u5e94\u7684\u914d\u7f6e\u5e76\u70b9\u51fb\u201c\u5f00\u59cb\u8c03\u8bd5\u201d\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u68c0\u67e5\u53d8\u91cf\u503c\u548c\u7a0b\u5e8f\u6d41\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728VSCode\u4e2d\u8c03\u7528Python\u7684\u65b9\u6cd5\u6709\uff1a\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6ePython\u89e3\u91ca\u5668\u3001\u521b\u5efaPython\u6587\u4ef6\u3001 [&hellip;]","protected":false},"author":3,"featured_media":935051,"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\/935050"}],"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=935050"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/935050\/revisions"}],"predecessor-version":[{"id":935052,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/935050\/revisions\/935052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/935051"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=935050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=935050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=935050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}