{"id":956015,"date":"2024-12-27T02:27:13","date_gmt":"2024-12-26T18:27:13","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/956015.html"},"modified":"2024-12-27T02:27:15","modified_gmt":"2024-12-26T18:27:15","slug":"%e5%a6%82%e4%bd%95%e7%94%a8vscode%e8%b0%83%e8%af%95python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/956015.html","title":{"rendered":"\u5982\u4f55\u7528vscode\u8c03\u8bd5python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25095737\/3cf8901f-4e05-4f18-a055-2d2e84740bb7.webp\" alt=\"\u5982\u4f55\u7528vscode\u8c03\u8bd5python\" \/><\/p>\n<p><p> \u4e00\u3001\u5982\u4f55\u7528VSCode\u8c03\u8bd5Python<\/p>\n<\/p>\n<p><p>\u5728VSCode\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\u662f\u4e00\u9879\u975e\u5e38\u5b9e\u7528\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u53d1\u73b0\u548c\u4fee\u590d\u4ee3\u7801\u4e2d\u7684\u9519\u8bef\u3002<strong>\u8981\u5728VSCode\u4e2d\u8c03\u8bd5Python\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Python\u6269\u5c55\u3001\u8bbe\u7f6e\u597d\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\u4ee5\u53ca\u719f\u6089\u8c03\u8bd5\u5de5\u5177\u7684\u4f7f\u7528<\/strong>\u3002\u5176\u4e2d\uff0c\u5b89\u88c5Python\u6269\u5c55\u662f\u7b2c\u4e00\u6b65\uff0c\u5b83\u4e3aVSCode\u63d0\u4f9b\u4e86Python\u8bed\u8a00\u7684\u652f\u6301\uff1b\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u5b9a\u4e49\u5982\u4f55\u8fd0\u884c\u548c\u8c03\u8bd5\u4f60\u7684\u7a0b\u5e8f\uff1b\u8c03\u8bd5\u5de5\u5177\u5219\u63d0\u4f9b\u4e86\u65ad\u70b9\u3001\u53d8\u91cf\u76d1\u89c6\u3001\u8c03\u7528\u5806\u6808\u7b49\u529f\u80fd\uff0c\u5e2e\u52a9\u4f60\u6df1\u5165\u4e86\u89e3\u4ee3\u7801\u7684\u6267\u884c\u8fc7\u7a0b\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u5728VSCode\u4e2d\u5b89\u88c5\u4e86Python\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7VSCode\u7684\u6269\u5c55\u5e02\u573a\u641c\u7d22\u201cPython\u201d\u5e76\u5b89\u88c5\u5fae\u8f6f\u63d0\u4f9b\u7684\u5b98\u65b9\u6269\u5c55\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0cVSCode\u5c06\u652f\u6301Python\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u8865\u5168\u4ee5\u53ca\u8c03\u8bd5\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5b89\u88c5\u548c\u914d\u7f6ePython\u6269\u5c55<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5Python\u6269\u5c55<\/strong><\/li>\n<\/ol>\n<p><p>\u5728VSCode\u4e2d\uff0c\u6253\u5f00\u6269\u5c55\uff08Extensions\uff09\u9762\u677f\uff0c\u641c\u7d22\u201cPython\u201d\uff0c\u7136\u540e\u5b89\u88c5\u7531Microsoft\u63d0\u4f9b\u7684Python\u6269\u5c55\u3002\u8fd9\u662f\u4f7f\u7528VSCode\u8fdb\u884cPython\u5f00\u53d1\u7684\u5fc5\u5907\u5de5\u5177\u3002\u8be5\u6269\u5c55\u4e0d\u4ec5\u652f\u6301\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u8865\u5168\uff0c\u8fd8\u63d0\u4f9b\u8c03\u8bd5\u3001\u6d4b\u8bd5\u3001\u4ee3\u7801\u683c\u5f0f\u5316\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u914d\u7f6ePython\u89e3\u91ca\u5668<\/strong><\/li>\n<\/ol>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u4e3a\u4f60\u7684\u9879\u76ee\u9009\u62e9\u5408\u9002\u7684Python\u89e3\u91ca\u5668\u3002\u70b9\u51fbVSCode\u72b6\u6001\u680f\u4e2d\u7684Python\u7248\u672c\u53f7\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e <code>Ctrl + Shift + P<\/code> \u6253\u5f00\u547d\u4ee4\u9762\u677f\uff0c\u8f93\u5165\u201cPython: Select Interpreter\u201d\u9009\u62e9\u4f60\u6240\u9700\u7684Python\u7248\u672c\u3002\u786e\u4fdd\u9009\u62e9\u7684\u89e3\u91ca\u5668\u662f\u4f60\u9879\u76ee\u73af\u5883\u4e0b\u7684Python\u7248\u672c\uff0c\u4ee5\u907f\u514d\u4f9d\u8d56\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u521b\u5efa\u548c\u7f16\u8f91\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6<\/p>\n<\/p>\n<ol>\n<li><strong>\u751f\u6210launch.json\u6587\u4ef6<\/strong><\/li>\n<\/ol>\n<p><p>\u5728VSCode\u4e2d\u6253\u5f00\u4f60\u7684Python\u9879\u76ee\uff0c\u6309\u4e0b\u5feb\u6377\u952e <code>F5<\/code>\uff0cVSCode\u4f1a\u81ea\u52a8\u63d0\u793a\u4f60\u9009\u62e9\u8c03\u8bd5\u73af\u5883\uff0c\u9009\u62e9\u201cPython File\u201d\u3002\u6b64\u65f6\uff0cVSCode\u5c06\u5728 <code>.vscode<\/code> \u6587\u4ef6\u5939\u4e2d\u81ea\u52a8\u751f\u6210\u4e00\u4e2a <code>launch.json<\/code> \u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u4ef6\u5b9a\u4e49\u4e86\u5982\u4f55\u8c03\u8bd5\u4f60\u7684Python\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u7f16\u8f91launch.json\u6587\u4ef6<\/strong><\/li>\n<\/ol>\n<p><p>\u5728 <code>launch.json<\/code> \u6587\u4ef6\u4e2d\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u9700\u6c42\u81ea\u5b9a\u4e49\u8c03\u8bd5\u914d\u7f6e\u3002\u5e38\u89c1\u7684\u914d\u7f6e\u9879\u5305\u62ec\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>&quot;program&quot;<\/code>: \u6307\u5b9a\u8981\u8c03\u8bd5\u7684Python\u6587\u4ef6\u3002<\/li>\n<li><code>&quot;args&quot;<\/code>: \u4e3a\u7a0b\u5e8f\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/li>\n<li><code>&quot;cwd&quot;<\/code>: \u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55\u3002<\/li>\n<li><code>&quot;env&quot;<\/code>: \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<p><p>\u786e\u4fdd\u8fd9\u4e9b\u914d\u7f6e\u7b26\u5408\u4f60\u7684\u9879\u76ee\u9700\u6c42\uff0c\u4ee5\u4fbf\u6b63\u786e\u8fd0\u884c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u65ad\u70b9\u8c03\u8bd5\u4ee3\u7801<\/p>\n<\/p>\n<ol>\n<li><strong>\u8bbe\u7f6e\u65ad\u70b9<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u4ee3\u7801\u884c\u53f7\u5904\u70b9\u51fb\uff0c\u6216\u8005\u6309\u5feb\u6377\u952e <code>F9<\/code>\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3002\u65ad\u70b9\u7528\u4e8e\u6682\u505c\u7a0b\u5e8f\u6267\u884c\uff0c\u4ee5\u4fbf\u68c0\u67e5\u5f53\u524d\u72b6\u6001\u3002\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u9700\u8981\u68c0\u67e5\u7684\u5730\u65b9\u8bbe\u7f6e\u65ad\u70b9\uff0c\u6bd4\u5982\u5faa\u73af\u3001\u6761\u4ef6\u8bed\u53e5\u3001\u51fd\u6570\u8c03\u7528\u7b49\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u542f\u52a8\u8c03\u8bd5<\/strong><\/li>\n<\/ol>\n<p><p>\u8bbe\u7f6e\u597d\u65ad\u70b9\u540e\uff0c\u6309\u4e0b <code>F5<\/code> \u542f\u52a8\u8c03\u8bd5\u3002\u7a0b\u5e8f\u5c06\u5728\u65ad\u70b9\u5904\u6682\u505c\uff0c\u5e76\u663e\u793a\u5f53\u524d\u884c\u7684\u6267\u884c\u60c5\u51b5\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u68c0\u67e5\u53d8\u91cf\u548c\u8c03\u7528\u5806\u6808<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8c03\u8bd5\u63a7\u5236\u53f0\u4e2d\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u53d8\u91cf\u7684\u5f53\u524d\u503c\uff0c\u76d1\u89c6\u7279\u5b9a\u53d8\u91cf\u7684\u53d8\u5316\uff0c\u68c0\u67e5\u8c03\u7528\u5806\u6808\u4ee5\u4e86\u89e3\u51fd\u6570\u8c03\u7528\u987a\u5e8f\u3002\u8fd9\u4e9b\u5de5\u5177\u80fd\u5e2e\u52a9\u4f60\u6df1\u5165\u5206\u6790\u7a0b\u5e8f\u884c\u4e3a\uff0c\u627e\u51fa\u95ee\u9898\u6240\u5728\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u8fdb\u884c\u6df1\u5165\u5206\u6790<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u53d8\u91cf\u76d1\u89c6<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201cWATCH\u201d\u9762\u677f\u76d1\u89c6\u7279\u5b9a\u53d8\u91cf\u7684\u503c\u3002\u53f3\u952e\u70b9\u51fb\u53d8\u91cf\u9009\u62e9\u201cAdd to Watch\u201d\uff0c\u6216\u5728\u201cWATCH\u201d\u9762\u677f\u4e2d\u624b\u52a8\u8f93\u5165\u53d8\u91cf\u8868\u8fbe\u5f0f\uff0cVSCode\u4f1a\u52a8\u6001\u66f4\u65b0\u5176\u503c\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8c03\u7528\u5806\u6808\u5206\u6790<\/strong><\/li>\n<\/ol>\n<p><p>\u201cCALL STACK\u201d\u9762\u677f\u663e\u793a\u5f53\u524d\u6267\u884c\u7684\u51fd\u6570\u8c03\u7528\u5806\u6808\u3002\u901a\u8fc7\u5206\u6790\u8c03\u7528\u5806\u6808\uff0c\u4f60\u53ef\u4ee5\u4e86\u89e3\u7a0b\u5e8f\u7684\u6267\u884c\u8def\u5f84\uff0c\u8ffd\u8e2a\u51fd\u6570\u8c03\u7528\u5173\u7cfb\uff0c\u627e\u51fa\u5f02\u5e38\u6216\u9519\u8bef\u7684\u6839\u672c\u539f\u56e0\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6761\u4ef6\u65ad\u70b9\u548c\u65e5\u5fd7\u8f93\u51fa<\/strong><\/li>\n<\/ol>\n<p><p>VSCode\u652f\u6301\u8bbe\u7f6e\u6761\u4ef6\u65ad\u70b9\uff0c\u901a\u8fc7\u53f3\u952e\u70b9\u51fb\u65ad\u70b9\u6807\u8bb0\uff0c\u9009\u62e9\u201cEdit Breakpoint\u201d\u53ef\u4ee5\u8bbe\u7f6e\u6761\u4ef6\u8868\u8fbe\u5f0f\u3002\u53ea\u6709\u5728\u6761\u4ef6\u6ee1\u8db3\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u5728\u65ad\u70b9\u5904\u6682\u505c\u3002\u6b64\u5916\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201cLogpoint\u201d\u529f\u80fd\u5728\u4e0d\u6682\u505c\u7a0b\u5e8f\u7684\u60c5\u51b5\u4e0b\u8f93\u51fa\u8c03\u8bd5\u4fe1\u606f\uff0c\u5e2e\u52a9\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u8c03\u8bd5\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<ol>\n<li><strong>\u65e0\u6cd5\u542f\u52a8\u8c03\u8bd5<\/strong><\/li>\n<\/ol>\n<p><p>\u5982\u679c\u65e0\u6cd5\u542f\u52a8\u8c03\u8bd5\uff0c\u9996\u5148\u68c0\u67e5 <code>launch.json<\/code> \u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u7279\u522b\u662f <code>&quot;program&quot;<\/code> \u8def\u5f84\u548c <code>&quot;pythonPath&quot;<\/code> \u8bbe\u7f6e\u3002\u786e\u4fdd\u9009\u62e9\u4e86\u6b63\u786e\u7684Python\u89e3\u91ca\u5668\uff0c\u5e76\u68c0\u67e5\u63a7\u5236\u53f0\u8f93\u51fa\u7684\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u65ad\u70b9\u4e0d\u751f\u6548<\/strong><\/li>\n<\/ol>\n<p><p>\u65ad\u70b9\u4e0d\u751f\u6548\u53ef\u80fd\u662f\u7531\u4e8e\u4ee3\u7801\u672a\u7f16\u8bd1\u6216\u5df2\u7f13\u5b58\u7684\u5b57\u8282\u7801\u672a\u66f4\u65b0\u3002\u5c1d\u8bd5\u6e05\u7406Python\u7f13\u5b58\u6587\u4ef6\uff08\u5982 <code>__pycache__<\/code> \u6587\u4ef6\u5939\uff09\uff0c\u786e\u4fdd\u4ee3\u7801\u5df2\u4fdd\u5b58\uff0c\u5e76\u91cd\u65b0\u542f\u52a8\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u73af\u5883\u53d8\u91cf\u548c\u4f9d\u8d56\u95ee\u9898<\/strong><\/li>\n<\/ol>\n<p><p>\u8c03\u8bd5\u65f6\u9700\u8981\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u5e93\u5df2\u5b89\u88c5\uff0c\u5e76\u6b63\u786e\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u53ef\u4ee5\u901a\u8fc7 <code>requirements.txt<\/code> \u5b89\u88c5\u9879\u76ee\u4f9d\u8d56\uff0c\u5e76\u5728 <code>launch.json<\/code> \u4e2d\u914d\u7f6e <code>&quot;env&quot;<\/code> \u4ee5\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u63d0\u9ad8\u8c03\u8bd5\u6548\u7387\u7684\u6280\u5de7<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u5feb\u6377\u952e<\/strong><\/li>\n<\/ol>\n<p><p>\u719f\u7ec3\u4f7f\u7528\u8c03\u8bd5\u5feb\u6377\u952e\u53ef\u4ee5\u63d0\u9ad8\u6548\u7387\u3002\u5e38\u7528\u5feb\u6377\u952e\u5305\u62ec\uff1a<code>F5<\/code>\uff08\u5f00\u59cb\/\u7ee7\u7eed\u8c03\u8bd5\uff09\u3001<code>F9<\/code>\uff08\u8bbe\u7f6e\/\u53d6\u6d88\u65ad\u70b9\uff09\u3001<code>F10<\/code>\uff08\u5355\u6b65\u8df3\u8fc7\uff09\u3001<code>F11<\/code>\uff08\u5355\u6b65\u8fdb\u5165\uff09\u3001<code>Shift + F5<\/code>\uff08\u505c\u6b62\u8c03\u8bd5\uff09\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4ee3\u7801\u91cd\u6784\u548c\u4f18\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u7684\u95ee\u9898\uff0c\u53ef\u80fd\u63d0\u793a\u4f60\u9700\u8981\u5bf9\u4ee3\u7801\u8fdb\u884c\u91cd\u6784\u6216\u4f18\u5316\u3002\u4fdd\u6301\u4ee3\u7801\u7b80\u6d01\u3001\u53ef\u8bfb\u6027\u5f3a\uff0c\u53ef\u4ee5\u51cf\u5c11bug\u7684\u53d1\u751f\uff0c\u63d0\u9ad8\u8c03\u8bd5\u6548\u7387\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5229\u7528\u96c6\u6210\u5de5\u5177<\/strong><\/li>\n<\/ol>\n<p><p>VSCode\u6709\u4e30\u5bcc\u7684\u6269\u5c55\u53ef\u4ee5\u8f85\u52a9\u8c03\u8bd5\u3002\u6bd4\u5982\uff0c\u4f7f\u7528Lint\u5de5\u5177\uff08\u5982Flake8\u3001Pylint\uff09\u53ef\u4ee5\u63d0\u524d\u53d1\u73b0\u8bed\u6cd5\u9519\u8bef\u6216\u4e0d\u89c4\u8303\u4ee3\u7801\uff1b\u96c6\u6210\u6d4b\u8bd5\u6846\u67b6\uff08\u5982Pytest\uff09\u53ef\u4ee5\u81ea\u52a8\u5316\u6d4b\u8bd5\uff0c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u516b\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>VSCode\u4e3aPython\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u5de5\u5177\uff0c\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u5927\u5e45\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u5feb\u901f\u5b9a\u4f4d\u548c\u4fee\u590d\u95ee\u9898\u3002\u901a\u8fc7\u5b89\u88c5Python\u6269\u5c55\u3001\u914d\u7f6e\u8c03\u8bd5\u73af\u5883\u3001\u8bbe\u7f6e\u65ad\u70b9\u4ee5\u53ca\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u8fdb\u884c\u6df1\u5165\u5206\u6790\uff0c\u4f60\u80fd\u591f\u5168\u9762\u638c\u63e1VSCode\u8c03\u8bd5Python\u7684\u6280\u5de7\u3002\u8bb0\u4f4f\uff0c\u8c03\u8bd5\u662f\u4e00\u9879\u6280\u80fd\uff0c\u968f\u7740\u7ecf\u9a8c\u7684\u79ef\u7d2f\uff0c\u4f60\u4f1a\u66f4\u52a0\u5f97\u5fc3\u5e94\u624b\u3002\u59cb\u7ec8\u4fdd\u6301\u5bf9\u4ee3\u7801\u7684\u654f\u611f\u548c\u5bf9\u95ee\u9898\u7684\u601d\u8003\uff0c\u624d\u80fd\u4e0d\u65ad\u63d0\u9ad8\u81ea\u5df1\u7684\u7f16\u7a0b\u6c34\u5e73\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 \/>\u5728VSCode\u4e2d\u914d\u7f6ePython\u8c03\u8bd5\u73af\u5883\u76f8\u5bf9\u7b80\u5355\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cVSCode\u3002\u63a5\u4e0b\u6765\uff0c\u6253\u5f00VSCode\u5e76\u5b89\u88c5Python\u6269\u5c55\u3002\u53ef\u4ee5\u5728\u6269\u5c55\u5e02\u573a\u4e2d\u641c\u7d22\u201cPython\u201d\uff0c\u627e\u5230\u5b98\u65b9\u7684Microsoft\u6269\u5c55\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u4f60\u7684Python\u9879\u76ee\u6216\u6587\u4ef6\uff0cVSCode\u4f1a\u81ea\u52a8\u8bc6\u522bPython\u73af\u5883\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a<code>launch.json<\/code>\u6587\u4ef6\u6765\u914d\u7f6e\u8c03\u8bd5\u9009\u9879\uff0c\u901a\u5e38\u53ef\u4ee5\u5728\u201c\u8fd0\u884c\u548c\u8c03\u8bd5\u201d\u9762\u677f\u4e2d\u81ea\u52a8\u751f\u6210\u3002<\/p>\n<p><strong>VSCode\u8c03\u8bd5Python\u65f6\u5e38\u89c1\u7684\u95ee\u9898\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5728\u4f7f\u7528VSCode\u8c03\u8bd5Python\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\uff0c\u4f8b\u5982\u65e0\u6cd5\u542f\u52a8\u8c03\u8bd5\u5668\u3001\u65ad\u70b9\u4e0d\u751f\u6548\u6216\u53d8\u91cf\u76d1\u89c6\u5931\u8d25\u7b49\u3002\u8fd9\u4e9b\u95ee\u9898\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5Python\u73af\u5883\u7684\u914d\u7f6e\u3001\u786e\u8ba4\u9879\u76ee\u4f9d\u8d56\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3001\u4ee5\u53ca\u786e\u4fdd\u4ee3\u7801\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\u6765\u89e3\u51b3\u3002\u6b64\u5916\uff0c\u786e\u4fddVSCode\u548cPython\u6269\u5c55\u662f\u6700\u65b0\u7248\u672c\u4e5f\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728VSCode\u4e2d\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u53f0\uff1f<\/strong><br \/>\u8c03\u8bd5\u63a7\u5236\u53f0\u662fVSCode\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\u3002\u5728\u8c03\u8bd5\u6a21\u5f0f\u4e0b\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201c\u8c03\u8bd5\u63a7\u5236\u53f0\u201d\u67e5\u770b\u8f93\u51fa\u548c\u9519\u8bef\u4fe1\u606f\uff0c\u751a\u81f3\u53ef\u4ee5\u76f4\u63a5\u5728\u63a7\u5236\u53f0\u4e2d\u8f93\u5165Python\u4ee3\u7801\u8fdb\u884c\u6d4b\u8bd5\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u5f53\u7a0b\u5e8f\u6682\u505c\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u63a7\u5236\u53f0\u67e5\u770b\u5f53\u524d\u53d8\u91cf\u7684\u503c\u6216\u6267\u884c\u8868\u8fbe\u5f0f\uff0c\u8fd9\u5bf9\u4e8e\u8bca\u65ad\u95ee\u9898\u548c\u8c03\u8bd5\u4ee3\u7801\u975e\u5e38\u6709\u5e2e\u52a9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u66f4\u76f4\u89c2\u5730\u4e86\u89e3\u4ee3\u7801\u7684\u6267\u884c\u60c5\u51b5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u5982\u4f55\u7528VSCode\u8c03\u8bd5Python \u5728VSCode\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\u662f\u4e00\u9879\u975e\u5e38\u5b9e\u7528\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1 [&hellip;]","protected":false},"author":3,"featured_media":956019,"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\/956015"}],"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=956015"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956015\/revisions"}],"predecessor-version":[{"id":956022,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/956015\/revisions\/956022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/956019"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=956015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=956015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=956015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}