{"id":1106341,"date":"2025-01-08T16:39:18","date_gmt":"2025-01-08T08:39:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1106341.html"},"modified":"2025-01-08T16:39:20","modified_gmt":"2025-01-08T08:39:20","slug":"vs2019%e9%87%8c%e9%9d%a2%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1106341.html","title":{"rendered":"vs2019\u91cc\u9762\u5982\u4f55\u4f7f\u7528python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25070827\/98d93519-342c-4af2-a5cb-09fad531a5b0.webp\" alt=\"vs2019\u91cc\u9762\u5982\u4f55\u4f7f\u7528python\" \/><\/p>\n<p><p> \u5728Visual Studio 2019\u4e2d\u4f7f\u7528Python\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u6765\u5b9e\u73b0\u3002\u5177\u4f53\u6b65\u9aa4\u5305\u62ec\uff1a\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u3001\u521b\u5efaPython\u9879\u76ee\u3001\u914d\u7f6ePython\u73af\u5883\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<strong>\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u3001\u521b\u5efaPython\u9879\u76ee\u3001\u914d\u7f6ePython\u73af\u5883\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/strong>\u662f\u4e3b\u8981\u6b65\u9aa4\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5176\u4e2d\u7684\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305<\/strong>\u662f\u4f7f\u7528Python\u7684\u7b2c\u4e00\u6b65\u3002\u5728Visual Studio 2019\u4e2d\uff0c\u6253\u5f00\u542f\u52a8\u9875\u9762\uff0c\u70b9\u51fb\u201c\u5de5\u5177\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u83b7\u53d6\u5de5\u5177\u548c\u529f\u80fd\u201d\u3002\u5728\u5f39\u51fa\u7684\u5b89\u88c5\u7a0b\u5e8f\u4e2d\uff0c\u9009\u62e9\u201cPython\u5f00\u53d1\u201d\u5de5\u4f5c\u8d1f\u8f7d\u5e76\u70b9\u51fb\u201c\u4fee\u6539\u201d\u6309\u94ae\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0cVisual Studio 2019\u5c06\u4f1a\u652f\u6301Python\u5f00\u53d1\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u662f\u4f7f\u7528Visual Studio 2019\u8fdb\u884cPython\u5f00\u53d1\u7684\u7b2c\u4e00\u6b65\u3002\u901a\u8fc7\u5b89\u88c5\u8fd9\u4e2a\u5de5\u5177\u5305\uff0c\u4f60\u5c06\u83b7\u5f97Python\u8bed\u8a00\u652f\u6301\u3001\u8c03\u8bd5\u5de5\u5177\u3001\u4ee3\u7801\u7f16\u8f91\u548c\u7ba1\u7406\u529f\u80fd\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00Visual Studio\u5b89\u88c5\u7a0b\u5e8f<\/strong>\uff1a<\/p>\n<p>\u8981\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\uff0c\u9996\u5148\u9700\u8981\u6253\u5f00Visual Studio\u5b89\u88c5\u7a0b\u5e8f\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728Windows\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22\u201cVisual Studio\u5b89\u88c5\u7a0b\u5e8f\u201d\u6765\u627e\u5230\u5e76\u8fd0\u884c\u5b83\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u5de5\u4f5c\u8d1f\u8f7d<\/strong>\uff1a<\/p>\n<p>\u5728Visual Studio\u5b89\u88c5\u7a0b\u5e8f\u4e2d\uff0c\u9009\u62e9\u201c\u4fee\u6539\u201d\u4ee5\u66f4\u6539\u73b0\u6709\u5b89\u88c5\u3002\u5728\u5de5\u4f5c\u8d1f\u8f7d\u9009\u9879\u5361\u4e0b\uff0c\u627e\u5230\u5e76\u52fe\u9009\u201cPython\u5f00\u53d1\u201d\u5de5\u4f5c\u8d1f\u8f7d\u3002\u8fd9\u5c06\u5305\u62ec\u6240\u6709\u5fc5\u8981\u7684\u5de5\u5177\u548c\u7ec4\u4ef6\uff0c\u4f7f\u4f60\u80fd\u591f\u5728Visual Studio\u4e2d\u8fdb\u884cPython\u5f00\u53d1\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u5de5\u5177\u5305<\/strong>\uff1a<\/p>\n<p>\u9009\u62e9\u201c\u4fee\u6539\u201d\u6309\u94ae\u5f00\u59cb\u5b89\u88c5\u8fc7\u7a0b\u3002\u5b89\u88c5\u65f6\u95f4\u53d6\u51b3\u4e8e\u4f60\u7684\u7f51\u7edc\u901f\u5ea6\u548c\u7535\u8111\u6027\u80fd\u3002\u5b8c\u6210\u540e\uff0c\u4f60\u5c06\u770b\u5230Python\u5f00\u53d1\u5de5\u5177\u5305\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u521b\u5efaPython\u9879\u76ee<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\u521b\u5efa\u4e00\u4e2aPython\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u4ee5\u4e0b\u6b65\u9aa4\u5c06\u6307\u5bfc\u4f60\u5982\u4f55\u521b\u5efa\u4e00\u4e2aPython\u9879\u76ee\u5e76\u5f00\u59cb\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u542f\u52a8Visual Studio<\/strong>\uff1a<\/p>\n<p>\u6253\u5f00Visual Studio 2019\uff0c\u70b9\u51fb\u201c\u521b\u5efa\u65b0\u9879\u76ee\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9Python\u9879\u76ee\u6a21\u677f<\/strong>\uff1a<\/p>\n<p>\u5728\u65b0\u5efa\u9879\u76ee\u5bf9\u8bdd\u6846\u4e2d\uff0c\u4f7f\u7528\u641c\u7d22\u680f\u641c\u7d22\u201cPython\u201d\u3002\u9009\u62e9\u201cPython\u5e94\u7528\u7a0b\u5e8f\u201d\u6a21\u677f\u5e76\u70b9\u51fb\u201c\u4e0b\u4e00\u6b65\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u9879\u76ee<\/strong>\uff1a<\/p>\n<p>\u8f93\u5165\u9879\u76ee\u540d\u79f0\u548c\u4f4d\u7f6e\uff0c\u7136\u540e\u70b9\u51fb\u201c\u521b\u5efa\u201d\u3002Visual Studio\u5c06\u751f\u6210\u4e00\u4e2a\u5305\u542b\u57fa\u672c\u7ed3\u6784\u7684Python\u9879\u76ee\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728\u89e3\u51b3\u65b9\u6848<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/58557.html\" target=\"_blank\">\u8d44\u6e90\u7ba1\u7406<\/a>\u5668\u4e2d\uff0c\u627e\u5230\u201cProgram.py\u201d\u6587\u4ef6\u5e76\u53cc\u51fb\u6253\u5f00\u3002\u4f60\u73b0\u5728\u53ef\u4ee5\u5728\u7f16\u8f91\u5668\u4e2d\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u914d\u7f6ePython\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\u914d\u7f6ePython\u73af\u5883\u662f\u786e\u4fdd\u4f60\u7684\u4ee3\u7801\u80fd\u591f\u6b63\u786e\u8fd0\u884c\u7684\u5173\u952e\u6b65\u9aa4\u3002\u4ee5\u4e0b\u662f\u914d\u7f6ePython\u73af\u5883\u7684\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9Python\u89e3\u91ca\u5668<\/strong>\uff1a<\/p>\n<p>\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u5de5\u5177\u201d-&gt;\u201c\u9009\u9879\u201d\u3002\u5728\u9009\u9879\u5bf9\u8bdd\u6846\u4e2d\uff0c\u5bfc\u822a\u5230\u201cPython\u201d-&gt;\u201c\u73af\u5883\u201d\u3002\u4f60\u5c06\u770b\u5230\u4e00\u4e2a\u53ef\u7528\u7684Python\u89e3\u91ca\u5668\u5217\u8868\u3002\u9009\u62e9\u4f60\u5e0c\u671b\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\uff0c\u5982\u679c\u5217\u8868\u4e2d\u6ca1\u6709\u4f60\u9700\u8981\u7684\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u70b9\u51fb\u201c\u6dfb\u52a0\u73af\u5883\u201d\u6765\u6dfb\u52a0\u5b83\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>\uff1a<\/p>\n<p>\u4e3a\u4e86\u907f\u514d\u4f9d\u8d56\u51b2\u7a81\uff0c\u5efa\u8bae\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\u3002\u5728\u89e3\u51b3\u65b9\u6848\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\uff0c\u53f3\u952e\u70b9\u51fb\u9879\u76ee\u5e76\u9009\u62e9\u201c\u6dfb\u52a0\u201d-&gt;\u201c\u865a\u62df\u73af\u5883\u201d\u3002\u6309\u7167\u63d0\u793a\u9009\u62e9Python\u89e3\u91ca\u5668\u5e76\u521b\u5efa\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\u5305<\/strong>\uff1a<\/p>\n<p>\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684Python\u5305\u3002\u4f60\u53ef\u4ee5\u5728\u201c\u89c6\u56fe\u201d-&gt;\u201c\u5176\u4ed6\u7a97\u53e3\u201d-&gt;\u201cPython\u73af\u5883\u201d\u4e2d\u627e\u5230\u865a\u62df\u73af\u5883\uff0c\u5e76\u4f7f\u7528\u201c\u5305\u201d\u9009\u9879\u5361\u6765\u5b89\u88c5\u548c\u7ba1\u7406\u4f9d\u8d56\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u662f\u5f00\u53d1\u8fc7\u7a0b\u7684\u6838\u5fc3\u3002\u4ee5\u4e0b\u6b65\u9aa4\u5c06\u5e2e\u52a9\u4f60\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728\u9879\u76ee\u4e2d\u6253\u5f00\u201cProgram.py\u201d\u6587\u4ef6\uff0c\u5e76\u7f16\u5199\u4f60\u7684Python\u4ee3\u7801\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    print(&quot;Hello, Visual Studio!&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u8c03\u8bd5\u201d-&gt;\u201c\u5f00\u59cb\u8c03\u8bd5\u201d\u6216\u6309F5\u952e\u6765\u8fd0\u884c\u4ee3\u7801\u3002\u4f60\u5c06\u770b\u5230\u8f93\u51fa\u7a97\u53e3\u663e\u793a\u201cHello, Visual Studio!\u201d\u3002\u5982\u679c\u4f60\u4e0d\u5e0c\u671b\u8c03\u8bd5\u8fd0\u884c\uff0c\u53ef\u4ee5\u9009\u62e9\u201c\u5f00\u59cb\u6267\u884c\uff08\u4e0d\u8c03\u8bd5\uff09\u201d\u6216\u6309Ctrl+F5\u952e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8c03\u8bd5\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>Visual Studio\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u5de5\u5177\u3002\u4f60\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u901a\u8fc7\u5355\u6b65\u6267\u884c\u3001\u68c0\u67e5\u53d8\u91cf\u3001\u8c03\u7528\u5806\u6808\u7b49\u529f\u80fd\u6765\u8c03\u8bd5\u4ee3\u7801\u3002\u8fd9\u4f7f\u4f60\u80fd\u591f\u5feb\u901f\u627e\u5230\u5e76\u4fee\u590d\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u4f7f\u7528Visual Studio\u4ee3\u7801\u7f16\u8f91\u529f\u80fd<\/p>\n<\/p>\n<p><p>Visual Studio 2019\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u529f\u80fd\uff0c\u4f7f\u4f60\u80fd\u591f\u66f4\u9ad8\u6548\u5730\u7f16\u5199\u548c\u7ba1\u7406Python\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5173\u952e\u529f\u80fd\u7684\u4ecb\u7ecd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4ee3\u7801\u81ea\u52a8\u5b8c\u6210<\/strong>\uff1a<\/p>\n<p>Visual Studio\u4e2d\u7684IntelliSense\u63d0\u4f9b\u4e86\u4ee3\u7801\u81ea\u52a8\u5b8c\u6210\u529f\u80fd\u3002\u5b83\u53ef\u4ee5\u6839\u636e\u4e0a\u4e0b\u6587\u63d0\u4f9b\u53d8\u91cf\u3001\u51fd\u6570\u3001\u7c7b\u7b49\u5efa\u8bae\uff0c\u5e2e\u52a9\u4f60\u5feb\u901f\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u683c\u5f0f\u5316<\/strong>\uff1a<\/p>\n<p>\u901a\u8fc7\u4f7f\u7528\u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u786e\u4fdd\u4ee3\u7801\u7b26\u5408PEP 8\u7b49\u7f16\u7801\u89c4\u8303\u3002\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d-&gt;\u201c\u9ad8\u7ea7\u201d-&gt;\u201c\u683c\u5f0f\u5316\u6587\u6863\u201d\u6216\u6309Ctrl+K\u3001Ctrl+D\u952e\u6765\u683c\u5f0f\u5316\u5f53\u524d\u6587\u6863\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u5bfc\u822a<\/strong>\uff1a<\/p>\n<p>Visual Studio\u63d0\u4f9b\u4e86\u591a\u79cd\u4ee3\u7801\u5bfc\u822a\u5de5\u5177\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Ctrl+\u70b9\u51fb\u8df3\u8f6c\u5230\u5b9a\u4e49\uff0c\u4f7f\u7528Ctrl+T\u641c\u7d22\u6587\u4ef6\u3001\u7c7b\u3001\u65b9\u6cd5\u7b49\u3002\u89e3\u51b3\u65b9\u6848\u8d44\u6e90\u7ba1\u7406\u5668\u548c\u7c7b\u89c6\u56fe\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5feb\u901f\u627e\u5230\u6240\u9700\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u91cd\u6784<\/strong>\uff1a<\/p>\n<p>Visual Studio\u4e2d\u7684\u91cd\u6784\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u91cd\u547d\u540d\u53d8\u91cf\u3001\u63d0\u53d6\u65b9\u6cd5\u3001\u91cd\u6784\u7c7b\u7b49\u3002\u53f3\u952e\u70b9\u51fb\u4ee3\u7801\u5e76\u9009\u62e9\u201c\u91cd\u6784\u201d\u83dc\u5355\u4e2d\u7684\u9009\u9879\u6765\u6267\u884c\u91cd\u6784\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u5982Git\uff09\u6765\u7ba1\u7406\u4f60\u7684Python\u9879\u76ee\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u7684\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521d\u59cb\u5316Git\u4ed3\u5e93<\/strong>\uff1a<\/p>\n<p>\u5728\u89e3\u51b3\u65b9\u6848\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\uff0c\u53f3\u952e\u70b9\u51fb\u9879\u76ee\u5e76\u9009\u62e9\u201cGit\u201d-&gt;\u201c\u521b\u5efaGit\u4ed3\u5e93\u201d\u3002\u8fd9\u5c06\u521d\u59cb\u5316\u4e00\u4e2a\u65b0\u7684Git\u4ed3\u5e93\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u201c.git\u201d\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u63d0\u4ea4\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728\u89e3\u51b3\u65b9\u6848\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\uff0c\u53f3\u952e\u70b9\u51fb\u9879\u76ee\u5e76\u9009\u62e9\u201cGit\u201d-&gt;\u201c\u63d0\u4ea4\u201d\u3002\u5728\u63d0\u4ea4\u5bf9\u8bdd\u6846\u4e2d\uff0c\u8f93\u5165\u63d0\u4ea4\u6d88\u606f\u5e76\u9009\u62e9\u8981\u63d0\u4ea4\u7684\u6587\u4ef6\uff0c\u7136\u540e\u70b9\u51fb\u201c\u63d0\u4ea4\u201d\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u540c\u6b65\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u8fdc\u7a0bGit\u4ed3\u5e93\uff08\u5982GitHub\u3001GitLab\u7b49\uff09\uff0c\u4f60\u53ef\u4ee5\u5c06\u672c\u5730\u4ed3\u5e93\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u540c\u6b65\u3002\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201cGit\u201d-&gt;\u201c\u7ba1\u7406\u8fdc\u7a0b\u4ed3\u5e93\u201d\u6765\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u201c\u63a8\u9001\u201d\u548c\u201c\u62c9\u53d6\u201d\u529f\u80fd\u6765\u540c\u6b65\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e03\u3001\u6269\u5c55Visual Studio\u529f\u80fd<\/p>\n<\/p>\n<p><p>Visual Studio 2019\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6269\u5c55\uff0c\u53ef\u4ee5\u589e\u5f3a\u4f60\u7684Python\u5f00\u53d1\u4f53\u9a8c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6709\u7528\u7684\u6269\u5c55\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u6269\u5c55<\/strong>\uff1a<\/p>\n<p>\u5728Visual Studio\u6269\u5c55\u5e02\u573a\u4e2d\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u8bb8\u591a\u4e0ePython\u5f00\u53d1\u76f8\u5173\u7684\u6269\u5c55\u3002\u4f8b\u5982\uff0cPython Tools for Visual Studio (PTVS) \u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u8c03\u8bd5\u548c\u7f16\u8f91\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u5206\u6790\u5de5\u5177<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528\u4ee3\u7801\u5206\u6790\u5de5\u5177\uff08\u5982Pylint\u3001Flake8\u7b49\uff09\u53ef\u4ee5\u5e2e\u52a9\u4f60\u53d1\u73b0\u4ee3\u7801\u4e2d\u7684\u6f5c\u5728\u95ee\u9898\u3002\u5728\u6269\u5c55\u5e02\u573a\u4e2d\u641c\u7d22\u5e76\u5b89\u88c5\u8fd9\u4e9b\u5de5\u5177\uff0c\u7136\u540e\u5728\u9879\u76ee\u8bbe\u7f6e\u4e2d\u914d\u7f6e\u5b83\u4eec\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5355\u5143\u6d4b\u8bd5\u6846\u67b6<\/strong>\uff1a<\/p>\n<p>\u5355\u5143\u6d4b\u8bd5\u662f\u786e\u4fdd\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u8981\u624b\u6bb5\u3002Visual Studio\u652f\u6301\u591a\u79cd\u5355\u5143\u6d4b\u8bd5\u6846\u67b6\uff08\u5982unittest\u3001pytest\u7b49\uff09\u3002\u5728\u6269\u5c55\u5e02\u573a\u4e2d\u641c\u7d22\u5e76\u5b89\u88c5\u76f8\u5e94\u7684\u6269\u5c55\uff0c\u7136\u540e\u5728\u9879\u76ee\u4e2d\u7f16\u5199\u548c\u8fd0\u884c\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516b\u3001\u6027\u80fd\u4f18\u5316\u548c\u8c03\u8bd5\u6280\u5de7<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\u8fdb\u884cPython\u5f00\u53d1\u65f6\uff0c\u4f18\u5316\u4ee3\u7801\u6027\u80fd\u548c\u4f7f\u7528\u9ad8\u7ea7\u8c03\u8bd5\u6280\u5de7\u53ef\u4ee5\u5e2e\u52a9\u4f60\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6709\u7528\u7684\u6280\u5de7\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6027\u80fd\u5206\u6790<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528Visual Studio\u7684\u6027\u80fd\u5206\u6790\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u8bc6\u522b\u4ee3\u7801\u4e2d\u7684\u6027\u80fd\u74f6\u9888\u3002\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u8c03\u8bd5\u201d-&gt;\u201c\u6027\u80fd\u63a2\u67e5\u5668\u201d\u6765\u542f\u52a8\u6027\u80fd\u5206\u6790\u3002\u5206\u6790\u7ed3\u679c\u5c06\u663e\u793a\u4ee3\u7801\u6267\u884c\u65f6\u95f4\u3001\u5185\u5b58\u4f7f\u7528\u7b49\u4fe1\u606f\uff0c\u5e2e\u52a9\u4f60\u4f18\u5316\u4ee3\u7801\u6027\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5185\u5b58\u8c03\u8bd5<\/strong>\uff1a<\/p>\n<p>Visual Studio\u63d0\u4f9b\u4e86\u5185\u5b58\u8c03\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u68c0\u6d4b\u548c\u4fee\u590d\u5185\u5b58\u6cc4\u6f0f\u3002\u5728\u83dc\u5355\u680f\u4e2d\uff0c\u70b9\u51fb\u201c\u8c03\u8bd5\u201d-&gt;\u201c\u5185\u5b58\u201d\u6765\u542f\u52a8\u5185\u5b58\u8c03\u8bd5\u3002\u4f60\u53ef\u4ee5\u67e5\u770b\u5185\u5b58\u5206\u914d\u60c5\u51b5\uff0c\u5e76\u627e\u5230\u53ef\u80fd\u7684\u5185\u5b58\u6cc4\u6f0f\u70b9\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u591a\u7ebf\u7a0b\u8c03\u8bd5<\/strong>\uff1a<\/p>\n<p>\u5982\u679c\u4f60\u7684Python\u4ee3\u7801\u4f7f\u7528\u4e86\u591a\u7ebf\u7a0b\uff0cVisual Studio\u63d0\u4f9b\u4e86\u591a\u7ebf\u7a0b\u8c03\u8bd5\u5de5\u5177\u3002\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u7ebf\u7a0b\u5217\u8868\u3001\u7ebf\u7a0b\u8c03\u7528\u5806\u6808\u7b49\u4fe1\u606f\uff0c\u5e2e\u52a9\u4f60\u89e3\u51b3\u591a\u7ebf\u7a0b\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u65e5\u5fd7\u8bb0\u5f55<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528\u65e5\u5fd7\u8bb0\u5f55\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u4ee3\u7801\u6267\u884c\u8fc7\u7a0b\u3002Python\u7684logging\u6a21\u5757\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u65e5\u5fd7\u8bb0\u5f55\uff0c\u5e76\u5728\u8c03\u8bd5\u65f6\u67e5\u770b\u65e5\u5fd7\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e5d\u3001\u96c6\u6210\u7b2c\u4e09\u65b9\u5de5\u5177\u548c\u670d\u52a1<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\uff0c\u4f60\u53ef\u4ee5\u96c6\u6210\u8bb8\u591a\u7b2c\u4e09\u65b9\u5de5\u5177\u548c\u670d\u52a1\uff0c\u589e\u5f3aPython\u5f00\u53d1\u4f53\u9a8c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u5de5\u5177\u548c\u670d\u52a1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Docker<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528Docker\u53ef\u4ee5\u5e2e\u52a9\u4f60\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\u5316\u7684\u5f00\u53d1\u73af\u5883\u3002\u5728Visual Studio\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Docker\u5de5\u5177\u6269\u5c55\u6765\u6784\u5efa\u3001\u8fd0\u884c\u548c\u8c03\u8bd5Docker\u5bb9\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Azure<\/strong>\uff1a<\/p>\n<p>\u5982\u679c\u4f60\u4f7f\u7528Microsoft Azure\u8fdb\u884c\u4e91\u5f00\u53d1\uff0cVisual Studio\u63d0\u4f9b\u4e86Azure\u5de5\u5177\u6269\u5c55\u3002\u4f60\u53ef\u4ee5\u5728Visual Studio\u4e2d\u7ba1\u7406Azure\u8d44\u6e90\uff0c\u90e8\u7f72\u548c\u8c03\u8bd5Azure\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6570\u636e\u5e93\u7ba1\u7406<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\uff08\u5982SQL Server\u3001MySQL\u7b49\uff09\u53ef\u4ee5\u5e2e\u52a9\u4f60\u7ba1\u7406\u9879\u76ee\u4e2d\u7684\u6570\u636e\u5e93\u3002\u5728Visual Studio\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u6570\u636e\u5de5\u5177\u6269\u5c55\u6765\u8fde\u63a5\u548c\u7ba1\u7406\u6570\u636e\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6301\u7eed\u96c6\u6210\u548c\u4ea4\u4ed8\uff08<a href=\"https:\/\/docs.pingcode.com\/blog\/devops\/52691.html\" target=\"_blank\">CI\/CD<\/a>\uff09<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528CI\/CD\u5de5\u5177\uff08\u5982Azure <a href=\"https:\/\/docs.pingcode.com\/blog\/devops\/20813.html\" target=\"_blank\">DevOps<\/a>\u3001GitHub Actions\u7b49\uff09\u53ef\u4ee5\u5e2e\u52a9\u4f60\u81ea\u52a8\u5316\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u8fc7\u7a0b\u3002\u5728Visual Studio\u4e2d\uff0c\u4f60\u53ef\u4ee5\u96c6\u6210\u8fd9\u4e9b\u5de5\u5177\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u914d\u7f6eCI\/CD\u7ba1\u9053\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5341\u3001\u5b66\u4e60\u548c\u63d0\u5347<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Visual Studio 2019\u8fdb\u884cPython\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6301\u7eed\u5b66\u4e60\u548c\u63d0\u5347\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5b66\u4e60\u8d44\u6e90\u548c\u63d0\u5347\u6280\u5de7\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b98\u65b9\u6587\u6863<\/strong>\uff1a<\/p>\n<p>Visual Studio\u548cPython\u5b98\u65b9\u6587\u6863\u662f\u975e\u5e38\u597d\u7684\u5b66\u4e60\u8d44\u6e90\u3002\u4f60\u53ef\u4ee5\u5728Microsoft Docs\u548cPython\u5b98\u65b9\u6587\u6863\u4e2d\u627e\u5230\u8be6\u7ec6\u7684\u4f7f\u7528\u8bf4\u660e\u548c\u793a\u4f8b\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728\u7ebf\u8bfe\u7a0b<\/strong>\uff1a<\/p>\n<p>\u53c2\u52a0\u5728\u7ebf\u8bfe\u7a0b\uff08\u5982Coursera\u3001Udemy\u7b49\uff09\u53ef\u4ee5\u7cfb\u7edf\u5730\u5b66\u4e60Python\u5f00\u53d1\u548cVisual Studio\u7684\u4f7f\u7528\u3002\u9009\u62e9\u9002\u5408\u81ea\u5df1\u6c34\u5e73\u548c\u9700\u6c42\u7684\u8bfe\u7a0b\u8fdb\u884c\u5b66\u4e60\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u793e\u533a\u548c\u8bba\u575b<\/strong>\uff1a<\/p>\n<p>\u52a0\u5165\u5f00\u53d1\u8005\u793e\u533a\u548c\u8bba\u575b\uff08\u5982Stack Overflow\u3001Reddit\u7b49\uff09\u53ef\u4ee5\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\u3001\u5206\u4eab\u7ecf\u9a8c\u3002\u79ef\u6781\u53c2\u4e0e\u793e\u533a\u8ba8\u8bba\uff0c\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u4ea4\u6d41\u5b66\u4e60\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9e\u8df5\u9879\u76ee<\/strong>\uff1a<\/p>\n<p>\u901a\u8fc7\u5b9e\u8df5\u9879\u76ee\u53ef\u4ee5\u63d0\u5347\u4f60\u7684\u5f00\u53d1\u6280\u80fd\u3002\u9009\u62e9\u4e00\u4e2a\u611f\u5174\u8da3\u7684\u9879\u76ee\uff0c\u5e94\u7528\u6240\u5b66\u77e5\u8bc6\u8fdb\u884c\u5f00\u53d1\u548c\u8c03\u8bd5\uff0c\u79ef\u7d2f\u5b9e\u9645\u7ecf\u9a8c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728Visual Studio 2019\u4e2d\u4f7f\u7528Python\u8fdb\u884c\u5f00\u53d1\uff0c\u9700\u8981\u7ecf\u8fc7\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u3001\u521b\u5efaPython\u9879\u76ee\u3001\u914d\u7f6ePython\u73af\u5883\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u7b49\u6b65\u9aa4\u3002\u901a\u8fc7\u4f7f\u7528Visual Studio\u63d0\u4f9b\u7684\u5f3a\u5927\u7f16\u8f91\u548c\u8c03\u8bd5\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u9ad8\u6548\u5730\u8fdb\u884cPython\u5f00\u53d1\u3002\u540c\u65f6\uff0c\u96c6\u6210\u7b2c\u4e09\u65b9\u5de5\u5177\u548c\u670d\u52a1\u3001\u4f18\u5316\u4ee3\u7801\u6027\u80fd\u3001\u6301\u7eed\u5b66\u4e60\u548c\u63d0\u5347\u4e5f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u4f60\u5728Visual Studio 2019\u4e2d\u66f4\u597d\u5730\u4f7f\u7528Python\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728VS2019\u4e2d\u5982\u4f55\u5b89\u88c5Python\u652f\u6301\uff1f<\/strong><br \/>\u8981\u5728Visual Studio 2019\u4e2d\u4f7f\u7528Python\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u4e86Python\u5de5\u4f5c\u8d1f\u8f7d\u3002\u5728\u5b89\u88c5Visual Studio\u65f6\uff0c\u53ef\u4ee5\u5728\u201c\u5de5\u4f5c\u8d1f\u8f7d\u201d\u9009\u9879\u4e2d\u9009\u62e9\u201cPython\u5f00\u53d1\u201d\u3002\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\u4e86Visual Studio\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u5de5\u5177\u201d\u83dc\u5355\u9009\u62e9\u201c\u83b7\u53d6\u5de5\u5177\u548c\u529f\u80fd\u201d\uff0c\u7136\u540e\u5728\u5de5\u4f5c\u8d1f\u8f7d\u4e2d\u52fe\u9009\u201cPython\u5f00\u53d1\u201d\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\uff1f<\/strong><br \/>\u521b\u5efa\u65b0\u7684Python\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u5728Visual Studio 2019\u4e2d\uff0c\u9009\u62e9\u201c\u6587\u4ef6\u201d\u83dc\u5355\uff0c\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u9009\u62e9\u201c\u9879\u76ee\u201d\u3002\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u53ef\u4ee5\u5728\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u201cPython\u201d\uff0c\u627e\u5230\u9002\u5408\u7684Python\u9879\u76ee\u6a21\u677f\uff0c\u5982\u201cPython\u5e94\u7528\u7a0b\u5e8f\u201d\u3002\u9009\u62e9\u540e\uff0c\u70b9\u51fb\u201c\u521b\u5efa\u201d\u6309\u94ae\uff0c\u5373\u53ef\u5f00\u59cb\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728VS2019\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\uff1f<\/strong><br \/>Visual Studio 2019\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u8c03\u8bd5Python\u4ee3\u7801\u3002\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\u540e\uff0c\u70b9\u51fb\u8c03\u8bd5\u6309\u94ae\uff08\u901a\u5e38\u662f\u7eff\u8272\u7684\u64ad\u653e\u6309\u94ae\uff09\uff0c\u4f1a\u542f\u52a8\u8c03\u8bd5\u5668\u3002\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u53d8\u91cf\u503c\u3001\u5806\u6808\u4fe1\u606f\uff0c\u5e76\u9010\u884c\u6267\u884c\u4ee3\u7801\uff0c\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u627e\u5230\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Visual Studio 2019\u4e2d\u4f7f\u7528Python\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u5f00\u53d1\u5de5\u5177\u5305\u6765\u5b9e\u73b0\u3002\u5177\u4f53\u6b65\u9aa4\u5305 [&hellip;]","protected":false},"author":3,"featured_media":1106348,"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\/1106341"}],"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=1106341"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1106341\/revisions"}],"predecessor-version":[{"id":1106350,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1106341\/revisions\/1106350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1106348"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1106341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1106341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1106341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}