{"id":20508,"date":"2024-11-19T09:37:26","date_gmt":"2024-11-19T01:37:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20508\/"},"modified":"2024-11-19T09:37:26","modified_gmt":"2024-11-19T01:37:26","slug":"vscode%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20508\/","title":{"rendered":"vscode\u5b89\u88c5\u6559\u7a0b\u5982\u4f55\u914d\u7f6e\u73af\u5883"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u914d\u7f6e visual studio code (vscode) \u4e2d\u7684\u73af\u5883\uff1f\u5b89\u88c5\u5e76\u6253\u5f00 vscode\u3002\u9009\u62e9 python \u89e3\u91ca\u5668\u3002\u5b89\u88c5 python \u548c code runner \u6269\u5c55\u3002\u521b\u5efa\u865a\u62df\u73af\u5883\uff08\u53ef\u9009\uff09\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 vscode \u4e2d\u3002\u8bbe\u7f6e python \u8def\u5f84\uff08\u53ef\u9009\uff09\u3002\u9a8c\u8bc1\u914d\u7f6e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040302182018333.jpg\" class=\"aligncenter\" title=\"vscode\u5b89\u88c5\u6559\u7a0b\u5982\u4f55\u914d\u7f6e\u73af\u5883\u63d2\u56fe\" alt=\"vscode\u5b89\u88c5\u6559\u7a0b\u5982\u4f55\u914d\u7f6e\u73af\u5883\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Visual Studio Code (VSCode) \u4e2d\u914d\u7f6e\u73af\u5883<\/strong><\/p>\n<p><strong>\u5b89\u88c5 VSCode<\/strong><\/p>\n<ol>\n<li>\u8bbf\u95ee Visual Studio Code \u7f51\u7ad9\uff08https:\/\/code.visualstudio.com\/\uff09\u3002<\/li>\n<li>\u4e0b\u8f7d\u9002\u7528\u4e8e\u60a8\u64cd\u4f5c\u7cfb\u7edf (Windows\u3001Mac\u3001Linux) \u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u3002<\/li>\n<\/ol>\n<p><strong>\u914d\u7f6e\u73af\u5883<\/strong><\/p>\n<ol>\n<li> <strong>\u6253\u5f00 VSCode\uff1a<\/strong>\u542f\u52a8 Visual Studio Code\u3002<\/li>\n<li> <strong>\u68c0\u67e5 Python \u73af\u5883\uff1a<\/strong>\u6309 Ctrl + Shift + P (Windows) \u6216 Cmd + Shift + P (Mac) \u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002\u8f93\u5165 Python: Select Interpreter \u5e76\u9009\u62e9 Python \u89e3\u91ca\u5668\u3002<\/li>\n<li> <strong>\u5b89\u88c5\u6269\u5c55\uff1a<\/strong>\u4ece\u6269\u5c55\u5e02\u573a\u5b89\u88c5\u5fc5\u8981\u7684 Python \u6269\u5c55\uff0c\u4f8b\u5982 Python \u548c Code Runner\u3002<\/li>\n<li> <strong>\u521b\u5efa\u865a\u62df\u73af\u5883\uff08\u53ef\u9009\uff09\uff1a<\/strong>\u865a\u62df\u73af\u5883\u53ef\u7528\u4e8e\u9694\u79bb\u4e0d\u540c\u7684 Python \u9879\u76ee\u3002\u8981\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u8bf7\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>python -m venv venv\nsource venv\/bin\/activate<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li> <strong>\u8bbe\u7f6e Python \u8def\u5f84\uff08\u53ef\u9009\uff09\uff1a<\/strong>\u5982\u679c\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u9700\u8981\u5c06\u865a\u62df\u73af\u5883\u7684 Python \u8def\u5f84\u6dfb\u52a0\u5230 VSCode \u4e2d\u3002\u5728 VSCode \u4e2d\uff0c\u8f6c\u5230 \u6587\u4ef6 &gt; \u9996\u9009\u9879 &gt; \u8bbe\u7f6e\u3002\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165 Path\uff0c\u5e76\u5c06\u5176\u503c\u8bbe\u7f6e\u4e3a\u865a\u62df\u73af\u5883\u4e2d\u7684 Python \u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<li> <strong>\u9a8c\u8bc1\u914d\u7f6e\uff1a<\/strong>\u5728\u7ec8\u7aef\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>python --version<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u663e\u793a Python \u7248\u672c\uff0c\u5219\u8868\u660e\u73af\u5883\u5df2\u6b63\u786e\u914d\u7f6e\u3002<\/p>\n<p><strong>\u5e38\u89c1\u95ee\u9898<\/strong><\/p>\n<ul>\n<li> <strong>\u627e\u4e0d\u5230 Python \u89e3\u91ca\u5668\uff1a<\/strong>\u786e\u4fdd\u5df2\u5b89\u88c5 Python \u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u4e2d\u3002<\/li>\n<li> <strong>\u65e0\u6cd5\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/strong>\u786e\u4fdd\u4f7f\u7528\u6b63\u786e\u7684 shell \u8fd0\u884c\u6fc0\u6d3b\u547d\u4ee4\u3002<\/li>\n<li> <strong>Python \u8def\u5f84\u9519\u8bef\uff1a<\/strong>\u68c0\u67e5\u865a\u62df\u73af\u5883\u4e2d\u7684 Python \u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u662f\u5426\u6b63\u786e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b89\u88c5\u6559\u7a0b\u5982\u4f55\u914d\u7f6e\u73af\u5883\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u914d\u7f6e visual studio code (vscode) \u4e2d\u7684\u73af\u5883\uff1f\u5b89\u88c5\u5e76\u6253\u5f00 vscode\u3002\u9009\u62e9 python \u89e3\u91ca\u5668\u3002\u5b89\u88c5 python \u548c code runner \u6269\u5c55\u3002\u521b\u5efa\u865a\u62df\u73af\u5883\uff08\u53ef\u9009\uff09\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 vscode \u4e2d\u3002\u8bbe\u7f6e python \u8def\u5f84\uff08\u53ef\u9009\uff09\u3002\u9a8c\u8bc1\u914d\u7f6e\u3002 \u5982\u4f55\u5728 Visual Studio Code (VSCode) \u4e2d\u914d\u7f6e\u73af\u5883 \u5b89\u88c5 VSCode \u8bbf\u95ee Visual Studio Code \u7f51\u7ad9\uff08https:\/\/code.visualstudio.com\/\uff09\u3002 \u4e0b\u8f7d\u9002\u7528\u4e8e\u60a8\u64cd\u4f5c\u7cfb\u7edf (Windows\u3001Mac\u3001Linux) \u7684\u5b89\u88c5\u7a0b\u5e8f\u3002 \u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u3002 \u914d\u7f6e\u73af\u5883 \u6253\u5f00 VSCode\uff1a\u542f\u52a8 Visual Studio Code\u3002 \u68c0\u67e5 Python \u73af\u5883\uff1a\u6309 Ctrl + Shift + P (Windows) \u6216 Cmd + Shift + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20508","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20508"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20508\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}