{"id":21262,"date":"2024-11-19T11:01:09","date_gmt":"2024-11-19T03:01:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21262\/"},"modified":"2024-11-19T11:01:09","modified_gmt":"2024-11-19T03:01:09","slug":"vscode%e6%80%8e%e4%b9%88%e8%a3%85python","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21262\/","title":{"rendered":"vscode\u600e\u4e48\u88c5python"},"content":{"rendered":"<blockquote><p>\n  \u5728 vscode \u4e2d\u5b89\u88c5 python\uff1a1. \u5b89\u88c5 python \u89e3\u91ca\u5668\uff1b2. \u5728 vscode \u4e2d\u5b89\u88c5 python \u6269\u5c55\uff1b3. \u9a8c\u8bc1\u5b89\u88c5\uff1b4. \u914d\u7f6e vscode python \u73af\u5883\uff1b5. \u4f7f\u7528 python\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/15\/2024051505121726916.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u88c5python\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u88c5python\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728 VSCode \u4e2d\u5b89\u88c5 Python<\/strong><\/p>\n<p>\u5728 VSCode \u4e2d\u5b89\u88c5 Python \u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\u5373\u53ef\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 Python \u89e3\u91ca\u5668<\/strong><\/p>\n<ul>\n<li>\u524d\u5f80 Python \u5b98\u65b9\u7f51\u7ad9\uff08https:\/\/www..org\/downloads\/\uff09\u4e0b\u8f7d\u4e0e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u5339\u914d\u7684 Python \u89e3\u91ca\u5668\u3002<\/li>\n<li>\u6309\u7167\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<p><strong>2. \u5728 VSCode \u4e2d\u5b89\u88c5 Python \u6269\u5c55<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\u3002<\/li>\n<li>\u5728\u6269\u5c55\u680f\u4e2d\u641c\u7d22\u201cPython\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u5b89\u88c5\u201d\u6309\u94ae\u5b89\u88c5 Microsoft \u63d0\u4f9b\u7684\u5b98\u65b9 Python \u6269\u5c55\u3002<\/li>\n<\/ul>\n<p><strong>3. \u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<ul>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00 VSCode \u4e2d\u7684\u7ec8\u7aef\uff08\u5feb\u6377\u952e\uff1aCtrl + `\uff09\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309 Enter\uff1a<\/li>\n<\/ul>\n<pre>python --version<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5982\u679c\u770b\u5230 Python \u7248\u672c\u53f7\uff0c\u5219\u8868\u793a\u5df2\u6210\u529f\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p><strong>4. \u914d\u7f6e VSCode Python \u73af\u5883<\/strong><\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\u6253\u5f00\u201c\u8bbe\u7f6e\u201d\u9875\u9762\uff08\u5feb\u6377\u952e\uff1aCtrl + ,\uff09\u3002<\/li>\n<li>\u5728\u641c\u7d22\u680f\u4e2d\u641c\u7d22\u201cPython\u201d\u3002<\/li>\n<li>\u5728\u201cPython: \u89e3\u91ca\u5668\u8def\u5f84\u201d\u4e0b\uff0c\u9009\u62e9\u60a8\u5b89\u88c5\u7684 Python \u89e3\u91ca\u5668\u3002<\/li>\n<li>\u5728\u201cPython: \u4f7f\u7528\u5185\u7f6e\u7ec8\u6b62\u201d\u4e0b\uff0c\u9009\u62e9\u201c\u662f\u201d\u4ee5\u5141\u8bb8 VSCode \u7ba1\u7406 Python \u7ec8\u6b62\u3002<\/li>\n<\/ul>\n<p><strong>5. \u4f7f\u7528 Python<\/strong><\/p>\n<ul>\n<li>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u5728 VSCode \u4e2d\u4f7f\u7528 Python\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5e76\u4fdd\u5b58\u4e3a .py \u6269\u5c55\u540d\uff0c\u4f8b\u5982 my_script.py\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u7f16\u5199 Python \u4ee3\u7801\u3002<\/li>\n<li>\u6309 F5 \u8fd0\u884c\u811a\u672c\uff0c\u6216\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>python my_script.py<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u5728\u5b89\u88c5\u6216\u4f7f\u7528 Python \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u67e5\u770b Python \u5b98\u65b9\u6587\u6863\u6216 VSCode \u8bba\u575b\u5bfb\u6c42\u5e2e\u52a9\u3002<\/li>\n<li>\u5efa\u8bae\u4f7f\u7528 Python \u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4e0d\u540c Python \u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u88c5\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>\u5728 vscode \u4e2d\u5b89\u88c5 python\uff1a1. \u5b89\u88c5 python \u89e3\u91ca\u5668\uff1b2. \u5728 vscode \u4e2d\u5b89\u88c5 python \u6269\u5c55\uff1b3. \u9a8c\u8bc1\u5b89\u88c5\uff1b4. \u914d\u7f6e vscode python \u73af\u5883\uff1b5. \u4f7f\u7528 python\u3002 \u5728 VSCode \u4e2d\u5b89\u88c5 Python \u5728 VSCode \u4e2d\u5b89\u88c5 Python \u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\u5373\u53ef\uff1a 1. \u5b89\u88c5 Python \u89e3\u91ca\u5668 \u524d\u5f80 Python \u5b98\u65b9\u7f51\u7ad9\uff08https:\/\/www..org\/downloads\/\uff09\u4e0b\u8f7d\u4e0e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u5339\u914d\u7684 Python \u89e3\u91ca\u5668\u3002 \u6309\u7167\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u64cd\u4f5c\u3002 2. \u5728 VSCode \u4e2d\u5b89\u88c5 Python \u6269\u5c55 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u6253\u5f00 VSCode\u3002 \u5728\u6269\u5c55\u680f\u4e2d\u641c\u7d22\u201cPython\u201d\u3002 \u70b9\u51fb\u201c\u5b89\u88c5\u201d\u6309\u94ae\u5b89\u88c5 Microsoft \u63d0\u4f9b\u7684\u5b98\u65b9 Python \u6269\u5c55\u3002 3. \u9a8c\u8bc1\u5b89\u88c5 [&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-21262","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21262","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=21262"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21262\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}