{"id":921546,"date":"2024-12-26T14:14:32","date_gmt":"2024-12-26T06:14:32","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/921546.html"},"modified":"2024-12-26T14:14:35","modified_gmt":"2024-12-26T06:14:35","slug":"vscode%e5%a6%82%e4%bd%95%e8%b0%83%e8%af%95python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/921546.html","title":{"rendered":"vscode\u5982\u4f55\u8c03\u8bd5python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210439\/94003f19-ebc2-4c5d-938a-b286531d4a50.webp\" alt=\"vscode\u5982\u4f55\u8c03\u8bd5python\" \/><\/p>\n<p><p> <strong>\u5728VSCode\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6e\u542f\u52a8\u914d\u7f6e\u6587\u4ef6\u3001\u8bbe\u7f6e\u65ad\u70b9\u548c\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0\u7b49\u6b65\u9aa4\u6765\u5b9e\u73b0\u3002\u5b89\u88c5Python\u6269\u5c55\u662f\u7b2c\u4e00\u6b65\uff0c\u5b83\u63d0\u4f9b\u4e86Python\u7684\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u81ea\u52a8\u5b8c\u6210\u548c\u8c03\u8bd5\u529f\u80fd\uff1b\u5176\u6b21\uff0c\u8c03\u8bd5\u4e4b\u524d\u9700\u8981\u521b\u5efalaunch.json\u6587\u4ef6\u6765\u914d\u7f6e\u8c03\u8bd5\u73af\u5883\uff1b\u7136\u540e\uff0c\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u901a\u8fc7F5\u5feb\u6377\u952e\u542f\u52a8\u8c03\u8bd5\u6a21\u5f0f\uff1b\u6700\u540e\uff0c\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0\u6765\u76d1\u63a7\u53d8\u91cf\u548c\u6267\u884c\u6d41\u7a0b\u3002\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6elaunch.json\u6587\u4ef6\u3001\u8bbe\u7f6e\u65ad\u70b9\u548c\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0\u662fVSCode\u8c03\u8bd5Python\u7684\u56db\u4e2a\u5173\u952e\u6b65\u9aa4\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5Python\u6269\u5c55<\/h3>\n<\/p>\n<p><p>VSCode\u672c\u8eab\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u4f46\u662f\u4e3a\u4e86\u652f\u6301\u4e0d\u540c\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u5b83\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u6269\u5c55\u3002\u5bf9\u4e8ePython\u5f00\u53d1\u8005\u6765\u8bf4\uff0cPython\u6269\u5c55\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Python\u6269\u5c55<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00VSCode\uff0c\u5728\u5de6\u4fa7\u6d3b\u52a8\u680f\u4e2d\u70b9\u51fb\u6269\u5c55\u56fe\u6807\uff08\u6216\u4f7f\u7528\u5feb\u6377\u952eCtrl+Shift+X\uff09\uff0c\u5728\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u201cPython\u201d\uff0c\u9009\u62e9\u7531Microsoft\u63d0\u4f9b\u7684Python\u6269\u5c55\u5e76\u5b89\u88c5\u3002\u8fd9\u4e2a\u6269\u5c55\u63d0\u4f9b\u4e86\u8c03\u8bd5\u652f\u6301\u3001\u4ee3\u7801\u81ea\u52a8\u5b8c\u6210\u3001Linting\u3001Jupyter\u652f\u6301\u7b49\u591a\u79cd\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u91cd\u542fVSCode\u3002\u6253\u5f00\u4e00\u4e2aPython\u6587\u4ef6\uff0c\u5982\u679c\u6269\u5c55\u5b89\u88c5\u6b63\u786e\uff0c\u60a8\u5e94\u8be5\u53ef\u4ee5\u770b\u5230\u4ee3\u7801\u6709\u8bed\u6cd5\u9ad8\u4eae\uff0c\u5e76\u4e14\u5728\u5e95\u90e8\u72b6\u6001\u680f\u4e2d\u4f1a\u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u914d\u7f6elaunch.json\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>launch.json\u6587\u4ef6\u662fVSCode\u4e2d\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u5b9a\u4e49\u4e86\u8c03\u8bd5\u7a0b\u5e8f\u7684\u542f\u52a8\u65b9\u5f0f\u3001\u53c2\u6570\u7b49\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efalaunch.json\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\u6309\u4e0bF5\u952e\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u9009\u62e9\u8c03\u8bd5\u73af\u5883\u3002\u9009\u62e9\u201cPython File\u201d\uff0cVSCode\u4f1a\u81ea\u52a8\u751f\u6210\u4e00\u4e2alaunch.json\u6587\u4ef6\u5e76\u5c06\u5176\u4fdd\u5b58\u5728.vscode\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u8c03\u8bd5\u53c2\u6570<\/strong><\/p>\n<\/p>\n<p><p>launch.json\u6587\u4ef6\u4e2d\u5305\u542b\u591a\u79cd\u8c03\u8bd5\u914d\u7f6e\u9879\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u8c03\u6574\u3002\u4f8b\u5982\uff0c&quot;program&quot;\u5b57\u6bb5\u7528\u4e8e\u6307\u5b9a\u8981\u8c03\u8bd5\u7684Python\u6587\u4ef6\u8def\u5f84\uff0c&quot;args&quot;\u5b57\u6bb5\u7528\u4e8e\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-json\">{<\/p>\n<p>    &quot;version&quot;: &quot;0.2.0&quot;,<\/p>\n<p>    &quot;configurations&quot;: [<\/p>\n<p>        {<\/p>\n<p>            &quot;name&quot;: &quot;Python: Current File&quot;,<\/p>\n<p>            &quot;type&quot;: &quot;python&quot;,<\/p>\n<p>            &quot;request&quot;: &quot;launch&quot;,<\/p>\n<p>            &quot;program&quot;: &quot;${file}&quot;,<\/p>\n<p>            &quot;console&quot;: &quot;integratedTerminal&quot;<\/p>\n<p>        }<\/p>\n<p>    ]<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5de5\u4f5c\u76ee\u5f55\u548c\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p>\u60a8\u53ef\u4ee5\u901a\u8fc7&quot;env&quot;\u5b57\u6bb5\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u901a\u8fc7&quot;cwd&quot;\u5b57\u6bb5\u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55\u3002\u8fd9\u4e9b\u8bbe\u7f6e\u5728\u9700\u8981\u7279\u5b9a\u8fd0\u884c\u73af\u5883\u7684\u9879\u76ee\u4e2d\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u8bbe\u7f6e\u65ad\u70b9<\/h3>\n<\/p>\n<p><p>\u65ad\u70b9\u662f\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u7528\u4e8e\u6682\u505c\u7a0b\u5e8f\u8fd0\u884c\u7684\u4f4d\u7f6e\uff0c\u4ee5\u4fbf\u89c2\u5bdf\u4ee3\u7801\u884c\u4e3a\u548c\u53d8\u91cf\u72b6\u6001\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5982\u4f55\u8bbe\u7f6e\u65ad\u70b9<\/strong><\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u884c\u53f7\u5de6\u4fa7\u7684\u7070\u8272\u533a\u57df\u6765\u8bbe\u7f6e\u65ad\u70b9\u3002\u8bbe\u7f6e\u540e\uff0c\u65ad\u70b9\u4f1a\u4ee5\u7ea2\u8272\u5706\u70b9\u663e\u793a\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6761\u4ef6\u65ad\u70b9<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u53ea\u5e0c\u671b\u5728\u7279\u5b9a\u6761\u4ef6\u4e0b\u6682\u505c\u6267\u884c\u3002\u53f3\u952e\u5355\u51fb\u65ad\u70b9\u56fe\u6807\uff0c\u53ef\u4ee5\u9009\u62e9\u201c\u7f16\u8f91\u65ad\u70b9\u201d\uff0c\u8f93\u5165\u6761\u4ef6\u8868\u8fbe\u5f0f\u3002\u53ea\u6709\u5f53\u6761\u4ef6\u4e3a\u771f\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u6682\u505c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ba1\u7406\u65ad\u70b9<\/strong><\/p>\n<\/p>\n<p><p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8c03\u8bd5\u9762\u677f\u7ba1\u7406\u6240\u6709\u65ad\u70b9\uff0c\u5305\u62ec\u542f\u7528\u3001\u7981\u7528\u548c\u5220\u9664\u65ad\u70b9\u3002\u8c03\u8bd5\u9762\u677f\u4f4d\u4e8e\u8c03\u8bd5\u5de5\u5177\u680f\u7684\u9876\u90e8\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0<\/h3>\n<\/p>\n<p><p>\u8c03\u8bd5\u63a7\u5236\u53f0\u662fVSCode\u8c03\u8bd5\u529f\u80fd\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u7528\u4e8e\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u68c0\u67e5\u53d8\u91cf\u503c\u3001\u6267\u884c\u8868\u8fbe\u5f0f\u548c\u67e5\u770b\u8f93\u51fa\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u542f\u52a8\u8c03\u8bd5<\/strong><\/p>\n<\/p>\n<p><p>\u8bbe\u7f6e\u597d\u65ad\u70b9\u540e\uff0c\u6309F5\u952e\u542f\u52a8\u8c03\u8bd5\u6a21\u5f0f\u3002\u7a0b\u5e8f\u4f1a\u5728\u7b2c\u4e00\u4e2a\u65ad\u70b9\u5904\u6682\u505c\uff0c\u60a8\u53ef\u4ee5\u5728\u8c03\u8bd5\u63a7\u5236\u53f0\u4e2d\u67e5\u770b\u5f53\u524d\u53d8\u91cf\u7684\u503c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8c03\u8bd5\u5de5\u5177\u680f<\/strong><\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u5de5\u5177\u680f\u63d0\u4f9b\u4e86\u591a\u79cd\u63a7\u5236\u9009\u9879\uff0c\u5305\u62ec\u7ee7\u7eed\u6267\u884c\u3001\u5355\u6b65\u6267\u884c\uff08F10\uff09\u3001\u8fdb\u5165\u51fd\u6570\uff08F11\uff09\u548c\u9000\u51fa\u51fd\u6570\uff08Shift+F11\uff09\u7b49\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u76d1\u89c6\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5c06\u611f\u5174\u8da3\u7684\u53d8\u91cf\u6dfb\u52a0\u5230\u201c\u76d1\u89c6\u201d\u7a97\u53e3\u3002\u53f3\u952e\u5355\u51fb\u53d8\u91cf\u9009\u62e9\u201c\u6dfb\u52a0\u5230\u76d1\u89c6\u201d\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u5b9e\u65f6\u67e5\u770b\u53d8\u91cf\u7684\u53d8\u5316\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884c\u8868\u8fbe\u5f0f<\/strong><\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u63a7\u5236\u53f0\u652f\u6301\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u8868\u8fbe\u5f0f\u3002\u60a8\u53ef\u4ee5\u7528\u5b83\u6765\u9a8c\u8bc1\u5047\u8bbe\u3001\u67e5\u770b\u51fd\u6570\u8fd4\u56de\u503c\u6216\u4e34\u65f6\u8ba1\u7b97\u6570\u636e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u5206\u6790\u8c03\u8bd5\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>\u8c03\u8bd5\u4e0d\u4ec5\u4ec5\u662f\u6682\u505c\u548c\u67e5\u770b\u4ee3\u7801\uff0c\u8fd8\u5305\u62ec\u5206\u6790\u8f93\u51fa\u548c\u9519\u8bef\u4fe1\u606f\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u7406\u89e3\u7a0b\u5e8f\u884c\u4e3a\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u63a7\u5236\u53f0\u8f93\u51fa<\/strong><\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u65f6\uff0c\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u51fa\u548c\u9519\u8bef\u8f93\u51fa\u4f1a\u663e\u793a\u5728\u8c03\u8bd5\u63a7\u5236\u53f0\u4e2d\u3002\u4ed4\u7ec6\u9605\u8bfb\u8fd9\u4e9b\u8f93\u51fa\u6709\u52a9\u4e8e\u53d1\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5f02\u5e38\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u5f53\u7a0b\u5e8f\u629b\u51fa\u5f02\u5e38\u65f6\uff0cVSCode\u4f1a\u81ea\u52a8\u6682\u505c\u5728\u5f02\u5e38\u53d1\u751f\u7684\u4f4d\u7f6e\u3002\u60a8\u53ef\u4ee5\u67e5\u770b\u8c03\u7528\u5806\u6808\u3001\u53d8\u91cf\u72b6\u6001\u6765\u5206\u6790\u95ee\u9898\u539f\u56e0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u65e5\u5fd7\u4fe1\u606f<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u590d\u6742\u9879\u76ee\u4e2d\uff0c\u60a8\u53ef\u80fd\u4f1a\u4f7f\u7528\u65e5\u5fd7\u8bb0\u5f55\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\u3002\u901a\u8fc7\u8c03\u8bd5\uff0c\u60a8\u53ef\u4ee5\u66f4\u597d\u5730\u5173\u8054\u65e5\u5fd7\u4fe1\u606f\u548c\u4ee3\u7801\u884c\u4e3a\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u8c03\u8bd5\u8fdc\u7a0bPython\u5e94\u7528<\/h3>\n<\/p>\n<p><p>VSCode\u4e0d\u4ec5\u652f\u6301\u672c\u5730\u8c03\u8bd5\uff0c\u8fd8\u53ef\u4ee5\u8c03\u8bd5\u8fd0\u884c\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684Python\u5e94\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u51c6\u5907\u8fdc\u7a0b\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\uff0c\u786e\u4fdd\u5b89\u88c5\u4e86Python\u89e3\u91ca\u5668\uff0c\u5e76\u901a\u8fc7SSH\u6216\u5176\u4ed6\u65b9\u5f0f\u53ef\u4ee5\u8bbf\u95ee\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6eSSH<\/strong><\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\u5b89\u88c5Remote &#8211; SSH\u6269\u5c55\uff0c\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u8fde\u63a5\u6210\u529f\u540e\uff0c\u60a8\u53ef\u4ee5\u5728VSCode\u4e2d\u50cf\u64cd\u4f5c\u672c\u5730\u6587\u4ef6\u4e00\u6837\u7f16\u8f91\u548c\u8c03\u8bd5\u8fdc\u7a0b\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u8fdc\u7a0b\u8c03\u8bd5\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<p><p>\u5728launch.json\u4e2d\uff0c\u914d\u7f6e\u8fdc\u7a0b\u8c03\u8bd5\u53c2\u6570\uff0c\u5982host\u3001port\u7b49\u3002\u786e\u4fdd\u8fdc\u7a0bPython\u5e94\u7528\u7684\u8c03\u8bd5\u7aef\u53e3\u5f00\u653e\u5e76\u53ef\u4ee5\u8bbf\u95ee\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-json\">{<\/p>\n<p>    &quot;name&quot;: &quot;Remote Debug&quot;,<\/p>\n<p>    &quot;type&quot;: &quot;python&quot;,<\/p>\n<p>    &quot;request&quot;: &quot;attach&quot;,<\/p>\n<p>    &quot;connect&quot;: {<\/p>\n<p>        &quot;host&quot;: &quot;remote-server-ip&quot;,<\/p>\n<p>        &quot;port&quot;: 5678<\/p>\n<p>    },<\/p>\n<p>    &quot;pathMappings&quot;: [<\/p>\n<p>        {<\/p>\n<p>            &quot;localRoot&quot;: &quot;${workspaceFolder}&quot;,<\/p>\n<p>            &quot;remoteRoot&quot;: &quot;\/path\/to\/remote\/workspace&quot;<\/p>\n<p>        }<\/p>\n<p>    ]<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8\u8fdc\u7a0b\u8c03\u8bd5<\/strong><\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u597d\u8fdc\u7a0b\u8c03\u8bd5\u540e\uff0c\u542f\u52a8VSCode\u7684\u8c03\u8bd5\u6a21\u5f0f\uff0c\u7a0b\u5e8f\u4f1a\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u5e76\u5f00\u59cb\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728VSCode\u4e2d\u9ad8\u6548\u5730\u8c03\u8bd5Python\u5e94\u7528\u7a0b\u5e8f\u3002\u8c03\u8bd5\u662f\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u73af\u8282\uff0c\u5b83\u4e0d\u4ec5\u5e2e\u52a9\u53d1\u73b0\u548c\u89e3\u51b3\u95ee\u9898\uff0c\u8fd8\u80fd\u52a0\u6df1\u5bf9\u4ee3\u7801\u7684\u7406\u89e3\uff0c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728VSCode\u4e2d\u914d\u7f6ePython\u8c03\u8bd5\u73af\u5883\uff1f<\/strong><br \/>\u8981\u5728Visual Studio Code\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5Python\u6269\u5c55\u3002\u6253\u5f00VSCode\u540e\uff0c\u524d\u5f80\u6269\u5c55\u5e02\u573a\uff0c\u641c\u7d22\u5e76\u5b89\u88c5\u201cPython\u201d\u6269\u5c55\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u521b\u5efa\u6216\u6253\u5f00\u4e00\u4e2aPython\u9879\u76ee\uff0c\u786e\u4fdd\u9879\u76ee\u4e2d\u6709\u4e00\u4e2aPython\u6587\u4ef6\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u5de6\u4fa7\u7684\u201c\u8fd0\u884c\u548c\u8c03\u8bd5\u201d\u56fe\u6807\uff0c\u9009\u62e9\u201c\u521b\u5efa\u4e00\u4e2alaunch.json\u6587\u4ef6\u201d\u6765\u751f\u6210\u8c03\u8bd5\u914d\u7f6e\uff0c\u8bbe\u7f6e\u8c03\u8bd5\u53c2\u6570\u5982\u7a0b\u5e8f\u8def\u5f84\u548c\u8fd0\u884c\u73af\u5883\u3002<\/p>\n<p><strong>VSCode\u8c03\u8bd5Python\u65f6\u9047\u5230\u95ee\u9898\u5e94\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5e38\u89c1\u7684\u8c03\u8bd5\u95ee\u9898\u5305\u62ec\u65e0\u6cd5\u542f\u52a8\u8c03\u8bd5\u5668\u3001\u65ad\u70b9\u672a\u751f\u6548\u7b49\u3002\u9047\u5230\u8fd9\u4e9b\u95ee\u9898\u65f6\uff0c\u53ef\u4ee5\u68c0\u67e5\u662f\u5426\u6b63\u786e\u5b89\u88c5\u4e86Python\u548c\u76f8\u5173\u7684VSCode\u6269\u5c55\u3002\u6b64\u5916\uff0c\u786e\u4fddPython\u8def\u5f84\u548c\u8fd0\u884c\u73af\u5883\u914d\u7f6e\u6b63\u786e\u3002\u67e5\u770b\u8f93\u51fa\u9762\u677f\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u901a\u5e38\u80fd\u591f\u63d0\u4f9b\u89e3\u51b3\u95ee\u9898\u7684\u7ebf\u7d22\u3002\u5982\u679c\u95ee\u9898\u4f9d\u65e7\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u542fVSCode\u6216\u68c0\u67e5\u9879\u76ee\u4f9d\u8d56\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728VSCode\u4e2d\u5982\u4f55\u4f7f\u7528\u8c03\u8bd5\u529f\u80fd\u76d1\u89c6\u53d8\u91cf\uff1f<\/strong><br \/>\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u4ee3\u7801\u884c\u5de6\u4fa7\u70b9\u51fb\u8bbe\u7f6e\u65ad\u70b9\uff0c\u542f\u52a8\u8c03\u8bd5\u540e\u7a0b\u5e8f\u4f1a\u5728\u65ad\u70b9\u5904\u6682\u505c\u3002\u5728\u8c03\u8bd5\u5de5\u5177\u680f\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u201c\u53d8\u91cf\u201d\u7a97\u53e3\uff0c\u76d1\u89c6\u5f53\u524d\u4f5c\u7528\u57df\u5185\u7684\u53d8\u91cf\u503c\u3002\u8fd8\u53ef\u4ee5\u5728\u201c\u89c2\u5bdf\u201d\u7a97\u53e3\u4e2d\u6dfb\u52a0\u9700\u8981\u76d1\u89c6\u7684\u53d8\u91cf\uff0c\u4ee5\u4fbf\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u5b9e\u65f6\u67e5\u770b\u5b83\u4eec\u7684\u503c\u53d8\u5316\u3002\u8fd9\u4e9b\u529f\u80fd\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u7406\u89e3\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u548c\u72b6\u6001\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728VSCode\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6e\u542f\u52a8\u914d\u7f6e\u6587\u4ef6\u3001\u8bbe\u7f6e\u65ad\u70b9\u548c\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0 [&hellip;]","protected":false},"author":3,"featured_media":921551,"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\/921546"}],"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=921546"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921546\/revisions"}],"predecessor-version":[{"id":921552,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921546\/revisions\/921552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/921551"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=921546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=921546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=921546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}