{"id":20558,"date":"2024-11-19T13:55:50","date_gmt":"2024-11-19T05:55:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20558\/"},"modified":"2024-11-19T13:55:50","modified_gmt":"2024-11-19T05:55:50","slug":"sublime%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cpython%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20558\/","title":{"rendered":"sublime\u600e\u4e48\u8fd0\u884cpython\u4ee3\u7801"},"content":{"rendered":"<blockquote><p>\n  \u5728 sublime text \u4e2d\u8fd0\u884c python \u4ee3\u7801\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 python \u89e3\u91ca\u5668\u3002\u5728\u8bbe\u7f6e\u4e2d\u8bbe\u7f6e python \u89e3\u91ca\u5668\u8def\u5f84\u3002\u4fdd\u5b58 python \u4ee3\u7801\u81f3 .py \u6587\u4ef6\u3002\u521b\u5efa\u4ee5 &#8220;python&#8221; \u5f00\u5934\u7684\u6784\u5efa\u7cfb\u7edf\u3002\u6309 ctrl + b (windows) \u6216 cmd + b (mac) \u8fd0\u884c\u4ee3\u7801\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040305331747599.jpg\" class=\"aligncenter\" title=\"sublime\u600e\u4e48\u8fd0\u884cpython\u4ee3\u7801\u63d2\u56fe\" alt=\"sublime\u600e\u4e48\u8fd0\u884cpython\u4ee3\u7801\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Sublime Text \u4e2d\u8fd0\u884c Python \u4ee3\u7801<\/strong><\/p>\n<p>\u4e3a\u4e86\u5728 Sublime Text \u4e2d\u8fd0\u884c Python \u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 Python \u89e3\u91ca\u5668<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u5df2\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Python \u89e3\u91ca\u5668\u3002\u60a8\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u3002<\/li>\n<\/ul>\n<p><strong>2. \u8bbe\u7f6e Sublime Text<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u6253\u5f00 Sublime Text \u5e76\u8f6c\u5230\u201c\u9996\u9009\u9879\u201d&gt;\u201c\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a<\/li>\n<\/ul>\n<pre>\"python_interpreter\": \"python.exe\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06 &#8220;.exe&#8221; \u66ff\u6362\u4e3a\u60a8\u5b89\u88c5\u7684 Python \u89e3\u91ca\u5668\u7684\u8def\u5f84\u3002<\/li>\n<\/ul>\n<p><strong>3. \u4fdd\u5b58 Python \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5c06\u60a8\u7684 Python \u4ee3\u7801\u4fdd\u5b58\u5728\u4e00\u4e2a .py \u6587\u4ef6\u4e2d\u3002<\/li>\n<\/ul>\n<p><strong>4. \u521b\u5efa\u6784\u5efa\u7cfb\u7edf<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u5de5\u5177\u201d&gt;\u201c\u6784\u5efa\u7cfb\u7edf\u201d&gt;\u201c\u65b0\u5efa\u6784\u5efa\u7cfb\u7edf\u201d\u3002<\/li>\n<li>\u5728\u201c\u547d\u4ee4\u201d\u5b57\u6bb5\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>\"python\" \"$file\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06\u6b64\u6784\u5efa\u7cfb\u7edf\u547d\u540d\u4e3a\u201cPython\u201d\u3002<\/li>\n<\/ul>\n<p><strong>5. \u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\u5c06\u5149\u6807\u653e\u5728 Python \u6587\u4ef6\u4e2d\u3002<\/li>\n<li>\u6309 Ctrl + B\uff08Windows\uff09\u6216 Cmd + B\uff08Mac\uff09\u8fd0\u884c\u6784\u5efa\u7cfb\u7edf\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u9009\u9879\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528\u63d2\u4ef6\uff1a<\/strong>\u60a8\u53ef\u4ee5\u5b89\u88c5 SublimeREPL\u3001Linter \u7b49\u63d2\u4ef6\uff0c\u4ee5\u589e\u5f3a Python \u7f16\u7801\u4f53\u9a8c\u3002<\/li>\n<li> <strong>\u4f7f\u7528\u63a7\u5236\u53f0\uff1a<\/strong>\u6253\u5f00 Sublime Text \u63a7\u5236\u53f0\uff08Ctrl + ~\uff09\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>python &lt;path_to_your_python_file.py&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9075\u5faa\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u60a8\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u5728 Sublime Text \u4e2d\u8fd0\u884c Python \u4ee3\u7801\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8fd0\u884c\u4ee3\u7801\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 sublime text \u4e2d\u8fd0\u884c python \u4ee3\u7801\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5b89\u88c5 python \u89e3\u91ca\u5668\u3002\u5728\u8bbe\u7f6e\u4e2d\u8bbe\u7f6e python \u89e3\u91ca\u5668\u8def\u5f84\u3002\u4fdd\u5b58 python \u4ee3\u7801\u81f3 .py \u6587\u4ef6\u3002\u521b\u5efa\u4ee5 &#8220;python&#8221; \u5f00\u5934\u7684\u6784\u5efa\u7cfb\u7edf\u3002\u6309 ctrl + b (windows) \u6216 cmd + b (mac) \u8fd0\u884c\u4ee3\u7801\u3002 \u5982\u4f55\u5728 Sublime Text \u4e2d\u8fd0\u884c Python \u4ee3\u7801 \u4e3a\u4e86\u5728 Sublime Text \u4e2d\u8fd0\u884c Python \u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 Python \u89e3\u91ca\u5668 \u786e\u4fdd\u5df2\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Python \u89e3\u91ca\u5668\u3002\u60a8\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u3002 2. \u8bbe\u7f6e Sublime Text \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u6253\u5f00 Sublime Text \u5e76\u8f6c\u5230\u201c\u9996\u9009\u9879\u201d&gt;\u201c\u8bbe\u7f6e\u201d\u3002 \u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a [&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-20558","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20558","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=20558"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20558\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}