{"id":21322,"date":"2024-11-19T14:24:26","date_gmt":"2024-11-19T06:24:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21322\/"},"modified":"2024-11-19T14:24:26","modified_gmt":"2024-11-19T06:24:26","slug":"vscode%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cpython","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21322\/","title":{"rendered":"vscode\u600e\u4e48\u8fd0\u884cpython"},"content":{"rendered":"<blockquote><p>\n  \u8fd0\u884c python \u7a0b\u5e8f\u53ef\u5728 vscode \u4e2d\u8f7b\u677e\u8fdb\u884c\uff1a\u786e\u8ba4 python \u89e3\u91ca\u5668\u5df2\u5b89\u88c5\u3002\u521b\u5efa python \u6587\u4ef6 (.py)\u3002\u7f16\u5199 python \u4ee3\u7801\u3002\u8bbe\u7f6e vscode \u7ec8\u7aef\u5de5\u4f5c\u76ee\u5f55\u3002\u4f7f\u7528\u4e24\u79cd\u65b9\u6cd5\u8fd0\u884c python \u6587\u4ef6\uff1a\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\uff1apython \u6587\u4ef6\u540d.py\u4f7f\u7528\u7eff\u8272\u4e09\u89d2\u5f62\u8fd0\u884c\u6309\u94ae\u3002\u67e5\u770b\u7a0b\u5e8f\u8f93\u51fa\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052709481844745.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u8fd0\u884cpython\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u8fd0\u884cpython\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 VSCode \u4e2d\u8fd0\u884c Python<\/strong><\/p>\n<p>\u5728 VSCode \u4e2d\u8fd0\u884c Python \u7a0b\u5e8f\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\u5373\u53ef\uff1a<\/p>\n<p><strong>1. \u786e\u8ba4 Python \u89e3\u91ca\u5668<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684 VSCode \u5df2\u5b89\u88c5 Python \u89e3\u91ca\u5668\u3002\u53ef\u4ee5\u5728\u201c\u7ec8\u7aef\u201d\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u68c0\u67e5\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>python --version<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u672a\u5b89\u88c5 Python \u89e3\u91ca\u5668\uff0c\u8bf7\u901a\u8fc7 Microsoft Store \u6216\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5 Python\u3002<\/p>\n<p><strong>2. \u521b\u5efa Python \u6587\u4ef6<\/strong><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728 VSCode \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Python \u6587\u4ef6\u3002\u70b9\u51fb\u201c\u6587\u4ef6\u201d &gt; \u201c\u65b0\u5efa\u201d &gt; \u201c\u6587\u4ef6\u201d\uff0c\u7136\u540e\u8f93\u5165\u5177\u6709 .py \u6269\u5c55\u540d\u7684\u65b0\u6587\u4ef6\u540d\u3002<\/p>\n<p><strong>3. \u7f16\u5199 Python \u4ee3\u7801<\/strong><\/p>\n<p>\u5728 Python \u6587\u4ef6\u4e2d\uff0c\u7f16\u5199\u8981\u6267\u884c\u7684 Python \u4ee3\u7801\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>print(\"Hello, world!\")<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u8bbe\u7f6e VSCode \u7ec8\u7aef<\/strong><\/p>\n<p>\u5728 VSCode \u7684\u5e95\u90e8\uff0c\u5355\u51fb\u201c\u7ec8\u7aef\u201d\u9009\u9879\u5361\u4ee5\u6253\u5f00 VSCode \u7ec8\u7aef\u3002\u786e\u4fdd\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u5df2\u8bbe\u7f6e\u4e3a\u4f60\u7684 Python \u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/p>\n<p><strong>5. \u8fd0\u884c Python \u6587\u4ef6<\/strong><\/p>\n<p>\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5728 VSCode \u4e2d\u8fd0\u884c Python \u6587\u4ef6\uff1a<\/p>\n<ul>\n<li><strong>\u65b9\u6cd5 1\uff1a\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c<\/strong><\/li>\n<\/ul>\n<p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c Python \u6587\u4ef6\uff1a<\/p>\n<pre>python \u6587\u4ef6\u540d.py<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li><strong>\u65b9\u6cd5 2\uff1a\u4f7f\u7528\u8fd0\u884c\u6309\u94ae<\/strong><\/li>\n<\/ul>\n<p>\u5728 VSCode \u7f16\u8f91\u5668\u4e2d\uff0c\u627e\u5230\u8fd0\u884c\u6309\u94ae\uff08\u7eff\u8272\u4e09\u89d2\u5f62\uff09\u3002\u5355\u51fb\u8be5\u6309\u94ae\uff0cVSCode \u5c06\u81ea\u52a8\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c Python \u6587\u4ef6\u3002<\/p>\n<p><strong>6. \u67e5\u770b\u8f93\u51fa<\/strong><\/p>\n<p>\u8fd0\u884c Python \u6587\u4ef6\u540e\uff0c\u8f93\u51fa\u5c06\u663e\u793a\u5728\u7ec8\u7aef\u4e2d\u3002\u4f60\u53ef\u4ee5\u770b\u5230\u7a0b\u5e8f\u7684\u7ed3\u679c\u6216\u4efb\u4f55\u9519\u8bef\u6d88\u606f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8fd0\u884c\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>\u8fd0\u884c python \u7a0b\u5e8f\u53ef\u5728 vscode \u4e2d\u8f7b\u677e\u8fdb\u884c\uff1a\u786e\u8ba4 python \u89e3\u91ca\u5668\u5df2\u5b89\u88c5\u3002\u521b\u5efa python \u6587\u4ef6 (.py)\u3002\u7f16\u5199 python \u4ee3\u7801\u3002\u8bbe\u7f6e vscode \u7ec8\u7aef\u5de5\u4f5c\u76ee\u5f55\u3002\u4f7f\u7528\u4e24\u79cd\u65b9\u6cd5\u8fd0\u884c python \u6587\u4ef6\uff1a\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\uff1apython \u6587\u4ef6\u540d.py\u4f7f\u7528\u7eff\u8272\u4e09\u89d2\u5f62\u8fd0\u884c\u6309\u94ae\u3002\u67e5\u770b\u7a0b\u5e8f\u8f93\u51fa\u3002 \u5982\u4f55\u5728 VSCode \u4e2d\u8fd0\u884c Python \u5728 VSCode \u4e2d\u8fd0\u884c Python \u7a0b\u5e8f\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\u5373\u53ef\uff1a 1. \u786e\u8ba4 Python \u89e3\u91ca\u5668 \u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684 VSCode \u5df2\u5b89\u88c5 Python \u89e3\u91ca\u5668\u3002\u53ef\u4ee5\u5728\u201c\u7ec8\u7aef\u201d\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u68c0\u67e5\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b python &#8211;version \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u672a\u5b89\u88c5 Python \u89e3\u91ca\u5668\uff0c\u8bf7\u901a\u8fc7 Microsoft Store \u6216\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5 Python\u3002 2. \u521b\u5efa Python \u6587\u4ef6 \u63a5\u4e0b\u6765\uff0c\u5728 VSCode \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Python \u6587\u4ef6\u3002\u70b9\u51fb\u201c\u6587\u4ef6\u201d [&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-21322","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21322","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=21322"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21322\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}