{"id":1081753,"date":"2025-01-08T12:42:27","date_gmt":"2025-01-08T04:42:27","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1081753.html"},"modified":"2025-01-08T12:42:30","modified_gmt":"2025-01-08T04:42:30","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e8%87%aa%e5%b7%b1%e7%bc%96%e8%be%91%e7%9a%84python%e4%bf%9d%e5%ad%98-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1081753.html","title":{"rendered":"\u5982\u4f55\u5c06\u81ea\u5df1\u7f16\u8f91\u7684python\u4fdd\u5b58"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24183615\/5ad951d5-f0a7-4943-98dd-bb8895c019f8.webp\" alt=\"\u5982\u4f55\u5c06\u81ea\u5df1\u7f16\u8f91\u7684python\u4fdd\u5b58\" \/><\/p>\n<p><p> <strong>\u4fdd\u5b58\u81ea\u5df1\u7f16\u8f91\u7684Python\u4ee3\u7801\u6709\u591a\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u547d\u4ee4\u884c\u4fdd\u5b58\u3001\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58<\/strong>\u3002\u6211\u4eec\u5c06\u5728\u672c\u6587\u4e2d\u8be6\u7ec6\u8ba8\u8bba\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff0c\u5373\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u4fdd\u5b58Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>Python\u662f\u4e00\u79cd\u975e\u5e38\u6d41\u884c\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3001Web\u5f00\u53d1\u7b49\u9886\u57df\u3002\u65e0\u8bba\u4f60\u662f\u521a\u5f00\u59cb\u5b66\u4e60Python\uff0c\u8fd8\u662f\u5df2\u7ecf\u662f\u4e00\u4e2a\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u4eba\u5458\uff0c\u4e86\u89e3\u5982\u4f55\u6b63\u786e\u4fdd\u5b58\u4f60\u7684Python\u4ee3\u7801\u90fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4fdd\u5b58Python\u4ee3\u7801\u53ef\u4ee5\u786e\u4fdd\u4f60\u7684\u5de5\u4f5c\u4e0d\u4f1a\u4e22\u5931\uff0c\u5e76\u4e14\u53ef\u4ee5\u65b9\u4fbf\u5730\u91cd\u65b0\u52a0\u8f7d\u548c\u8fd0\u884c\u4ee3\u7801\u3002\u4e0b\u9762\u6211\u4eec\u6765\u8be6\u7ec6\u8bb2\u89e3\u5982\u4f55\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u4fdd\u5b58\u4f60\u7684Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4fdd\u5b58Python\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u662f\u4e00\u79cd\u8f6f\u4ef6\u5e94\u7528\u7a0b\u5e8f\uff0c\u63d0\u4f9b\u5168\u9762\u7684\u8bbe\u65bd\u6765\u8ba1\u7b97\u673a\u7a0b\u5e8f\u5f00\u53d1\u3002IDE\u901a\u5e38\u5305\u62ec\u6e90\u4ee3\u7801\u7f16\u8f91\u5668\u3001\u6784\u5efa\u81ea\u52a8\u5316\u5de5\u5177\u548c\u8c03\u8bd5\u5668\u3002\u4f7f\u7528IDE\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7f16\u5199\u4ee3\u7801\u7684\u6548\u7387\uff0c\u5e76\u4e14\u5927\u591a\u6570IDE\u90fd\u5177\u6709\u4fdd\u5b58\u6587\u4ef6\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u9009\u62e9\u5408\u9002\u7684IDE<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684IDE\u662f\u7f16\u5199\u548c\u4fdd\u5b58Python\u4ee3\u7801\u7684\u7b2c\u4e00\u6b65\u3002\u5f53\u524d\u5e02\u573a\u4e0a\u6709\u8bb8\u591a\u4f18\u79c0\u7684IDE\u4f9b\u5f00\u53d1\u8005\u9009\u62e9\uff0c\u5305\u62ecPyCharm\u3001Visual Studio Code\uff08VS Code\uff09\u3001Jupyter Notebook\u3001Spyder\u7b49\u3002\u8fd9\u4e9bIDE\u90fd\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u9ad8\u6548\u5730\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>PyCharm<\/strong>: PyCharm\u662f\u7531JetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u5f00\u53d1\u7684\u4e00\u6b3ePython IDE\uff0c\u5177\u6709\u667a\u80fd\u4ee3\u7801\u8865\u5168\u3001\u9879\u76ee\u5bfc\u822a\u3001\u4ee3\u7801\u5206\u6790\u7b49\u529f\u80fd\u3002PyCharm\u652f\u6301\u591a\u79cd\u7248\u672c\u7684Python\uff0c\u5e76\u4e14\u53ef\u4ee5\u901a\u8fc7\u63d2\u4ef6\u6269\u5c55\u5176\u529f\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Visual Studio Code<\/strong>: VS Code\u662f\u7531\u5fae\u8f6f\u5f00\u53d1\u7684\u4e00\u6b3e\u5f00\u6e90\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002VS Code\u5177\u6709\u5f3a\u5927\u7684\u63d2\u4ef6\u7cfb\u7edf\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u63d2\u4ef6\u6765\u589e\u5f3a\u5176\u5bf9Python\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Jupyter Notebook<\/strong>: Jupyter Notebook\u662f\u4e00\u6b3e\u975e\u5e38\u53d7\u6b22\u8fce\u7684\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u9886\u57df\u3002Jupyter Notebook\u5141\u8bb8\u7528\u6237\u5728\u4e00\u4e2a\u6587\u6863\u4e2d\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\uff0c\u5e76\u4e14\u53ef\u4ee5\u65b9\u4fbf\u5730\u4fdd\u5b58\u548c\u5206\u4eab\u6587\u6863\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u521b\u5efa\u548c\u4fdd\u5b58Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u4e86\u5408\u9002\u7684IDE\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u521b\u5efa\u548c\u4fdd\u5b58Python\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyCharm\u548cVS Code\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>PyCharm<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5PyCharm<\/strong>: \u9996\u5148\u9700\u8981\u4ecePyCharm\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002\u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u9879\u76ee<\/strong>: \u6253\u5f00PyCharm\u540e\uff0c\u70b9\u51fb&quot;Create New Project&quot;\u6309\u94ae\uff0c\u9009\u62e9\u9879\u76ee\u7684\u5b58\u50a8\u8def\u5f84\u548cPython\u89e3\u91ca\u5668\uff0c\u7136\u540e\u70b9\u51fb&quot;Create&quot;\u6309\u94ae\u521b\u5efa\u9879\u76ee\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efaPython\u6587\u4ef6<\/strong>: \u5728\u9879\u76ee\u76ee\u5f55\u4e0a\u70b9\u51fb\u53f3\u952e\uff0c\u9009\u62e9&quot;New&quot; -&gt; &quot;Python File&quot;\uff0c\u8f93\u5165\u6587\u4ef6\u540d\u5e76\u70b9\u51fb&quot;OK&quot;\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>: \u5728\u65b0\u5efa\u7684Python\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong>: \u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save All&quot;\u9009\u9879\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+S<\/code>\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>Visual Studio Code<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5VS Code<\/strong>: \u9996\u5148\u9700\u8981\u4eceVS Code\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5VS Code\u3002\u5b89\u88c5\u8fc7\u7a0b\u540c\u6837\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python\u63d2\u4ef6<\/strong>: \u6253\u5f00VS Code\u540e\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684\u6269\u5c55\u56fe\u6807\uff0c\u641c\u7d22&quot;Python&quot;\uff0c\u7136\u540e\u70b9\u51fb&quot;Install&quot;\u6309\u94ae\u5b89\u88c5Python\u63d2\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efaPython\u6587\u4ef6<\/strong>: \u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;New File&quot;\u9009\u9879\uff0c\u7136\u540e\u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save As&quot;\u9009\u9879\uff0c\u9009\u62e9\u6587\u4ef6\u7684\u5b58\u50a8\u8def\u5f84\uff0c\u8f93\u5165\u6587\u4ef6\u540d\u5e76\u70b9\u51fb&quot;Save&quot;\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>: \u5728\u65b0\u5efa\u7684Python\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong>: \u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save&quot;\u9009\u9879\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+S<\/code>\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u5e76\u4fdd\u5b58\u4e86Python\u4ee3\u7801\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u8fd0\u884c\u4ee3\u7801\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyCharm\u548cVS Code\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>PyCharm<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>: \u5728PyCharm\u4e2d\uff0c\u70b9\u51fb\u4ee3\u7801\u7f16\u8f91\u7a97\u53e3\u4e0a\u65b9\u7684\u7eff\u8272\u4e09\u89d2\u5f62\u6309\u94ae\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Shift+F10<\/code>\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u67e5\u770b\u8f93\u51fa<\/strong>: \u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u5728PyCharm\u7684\u8fd0\u884c\u7a97\u53e3\u4e2d\u67e5\u770b\u4ee3\u7801\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>Visual Studio Code<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>: \u5728VS Code\u4e2d\uff0c\u70b9\u51fb\u4ee3\u7801\u7f16\u8f91\u7a97\u53e3\u4e0a\u65b9\u7684\u7eff\u8272\u4e09\u89d2\u5f62\u6309\u94ae\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+F5<\/code>\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u67e5\u770b\u8f93\u51fa<\/strong>: \u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u5728VS Code\u7684\u7ec8\u7aef\u7a97\u53e3\u4e2d\u67e5\u770b\u4ee3\u7801\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u4fdd\u5b58Python\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4fdd\u5b58Python\u4ee3\u7801\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u4fdd\u5b58Python\u4ee3\u7801\u3002\u547d\u4ee4\u884c\u662f\u4e00\u4e2a\u6587\u672c\u754c\u9762\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u4e0e\u8ba1\u7b97\u673a\u8fdb\u884c\u4ea4\u4e92\u3002\u4f7f\u7528\u547d\u4ee4\u884c\u4fdd\u5b58Python\u4ee3\u7801\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><h3>\u521b\u5efaPython\u6587\u4ef6<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c<\/strong>: \u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6309<code>Win+R<\/code>\u5feb\u6377\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\u5e76\u6309\u56de\u8f66\u952e\u6253\u5f00\u547d\u4ee4\u884c\u3002\u5728macOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u6587\u4ef6<\/strong>: \u4f7f\u7528\u547d\u4ee4<code>cd<\/code>\u5207\u6362\u5230\u60f3\u8981\u4fdd\u5b58\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7136\u540e\u4f7f\u7528\u547d\u4ee4<code>touch<\/code>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>hello.py<\/code>\u7684\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">touch hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u7f16\u5199\u548c\u4fdd\u5b58\u4ee3\u7801<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u8f91\u6587\u4ef6<\/strong>: \u4f7f\u7528\u547d\u4ee4<code>nano<\/code>\u6253\u5f00\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00<code>hello.py<\/code>\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">nano hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>: \u5728<code>nano<\/code>\u7f16\u8f91\u5668\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong>: \u6309<code>Ctrl+O<\/code>\u5feb\u6377\u952e\u4fdd\u5b58\u6587\u4ef6\uff0c\u6309\u56de\u8f66\u952e\u786e\u8ba4\u4fdd\u5b58\uff0c\u7136\u540e\u6309<code>Ctrl+X<\/code>\u5feb\u6377\u952e\u9000\u51fa\u7f16\u8f91\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>: \u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cPython\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u67e5\u770b\u8f93\u51fa<\/strong>: \u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u67e5\u770b\u4ee3\u7801\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58Python\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u548c\u547d\u4ee4\u884c\u4fdd\u5b58Python\u4ee3\u7801\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58Python\u4ee3\u7801\u3002\u6587\u672c\u7f16\u8f91\u5668\u662f\u4e00\u79cd\u7528\u4e8e\u7f16\u8f91\u7eaf\u6587\u672c\u6587\u4ef6\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e38\u89c1\u7684\u6587\u672c\u7f16\u8f91\u5668\u5305\u62ecNotepad++\u3001Sublime Text\u3001Atom\u7b49\u3002\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58Python\u4ee3\u7801\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><h3>\u9009\u62e9\u5408\u9002\u7684\u6587\u672c\u7f16\u8f91\u5668<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u6587\u672c\u7f16\u8f91\u5668\u662f\u7f16\u5199\u548c\u4fdd\u5b58Python\u4ee3\u7801\u7684\u7b2c\u4e00\u6b65\u3002\u5f53\u524d\u5e02\u573a\u4e0a\u6709\u8bb8\u591a\u4f18\u79c0\u7684\u6587\u672c\u7f16\u8f91\u5668\u4f9b\u5f00\u53d1\u8005\u9009\u62e9\uff0c\u5305\u62ecNotepad++\u3001Sublime Text\u3001Atom\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Notepad++<\/strong>: Notepad++\u662f\u4e00\u6b3e\u514d\u8d39\u7684\u6e90\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002Notepad++\u5177\u6709\u8bed\u6cd5\u9ad8\u4eae\u663e\u793a\u3001\u4ee3\u7801\u6298\u53e0\u7b49\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Sublime Text<\/strong>: Sublime Text\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002Sublime Text\u5177\u6709\u8bed\u6cd5\u9ad8\u4eae\u663e\u793a\u3001\u4ee3\u7801\u8865\u5168\u7b49\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Atom<\/strong>: Atom\u662f\u4e00\u6b3e\u7531GitHub\u5f00\u53d1\u7684\u5f00\u6e90\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002Atom\u5177\u6709\u8bed\u6cd5\u9ad8\u4eae\u663e\u793a\u3001\u63d2\u4ef6\u6269\u5c55\u7b49\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u521b\u5efa\u548c\u4fdd\u5b58Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u4e86\u5408\u9002\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u521b\u5efa\u548c\u4fdd\u5b58Python\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Notepad++\u548cSublime Text\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>Notepad++<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Notepad++<\/strong>: \u9996\u5148\u9700\u8981\u4eceNotepad++\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5Notepad++\u3002\u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efaPython\u6587\u4ef6<\/strong>: \u6253\u5f00Notepad++\u540e\uff0c\u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;New&quot;\u9009\u9879\uff0c\u7136\u540e\u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save As&quot;\u9009\u9879\uff0c\u9009\u62e9\u6587\u4ef6\u7684\u5b58\u50a8\u8def\u5f84\uff0c\u8f93\u5165\u6587\u4ef6\u540d\u5e76\u70b9\u51fb&quot;Save&quot;\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>: \u5728\u65b0\u5efa\u7684Python\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong>: \u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save&quot;\u9009\u9879\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+S<\/code>\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>Sublime Text<\/h4>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Sublime Text<\/strong>: \u9996\u5148\u9700\u8981\u4eceSublime Text\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5Sublime Text\u3002\u5b89\u88c5\u8fc7\u7a0b\u540c\u6837\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efaPython\u6587\u4ef6<\/strong>: \u6253\u5f00Sublime Text\u540e\uff0c\u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;New File&quot;\u9009\u9879\uff0c\u7136\u540e\u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save As&quot;\u9009\u9879\uff0c\u9009\u62e9\u6587\u4ef6\u7684\u5b58\u50a8\u8def\u5f84\uff0c\u8f93\u5165\u6587\u4ef6\u540d\u5e76\u70b9\u51fb&quot;Save&quot;\u6309\u94ae\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>: \u5728\u65b0\u5efa\u7684Python\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u6587\u4ef6<\/strong>: \u70b9\u51fb&quot;File&quot;\u83dc\u5355\uff0c\u9009\u62e9&quot;Save&quot;\u9009\u9879\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+S<\/code>\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u5e76\u4fdd\u5b58\u4e86Python\u4ee3\u7801\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u8fd0\u884c\u4ee3\u7801\u7684\u8fc7\u7a0b\u3002\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c<\/strong>: \u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6309<code>Win+R<\/code>\u5feb\u6377\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\u5e76\u6309\u56de\u8f66\u952e\u6253\u5f00\u547d\u4ee4\u884c\u3002\u5728macOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5207\u6362\u76ee\u5f55<\/strong>: \u4f7f\u7528\u547d\u4ee4<code>cd<\/code>\u5207\u6362\u5230\u4fdd\u5b58Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd \/path\/to\/your\/file<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4ee3\u7801<\/strong>: \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cPython\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u67e5\u770b\u8f93\u51fa<\/strong>: \u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u67e5\u770b\u4ee3\u7801\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u8be6\u7ec6\u8bb2\u89e3\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86\u5982\u4f55\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u547d\u4ee4\u884c\u548c\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58Python\u4ee3\u7801\u3002\u65e0\u8bba\u4f60\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u4fdd\u5b58Python\u4ee3\u7801\u7684\u57fa\u672c\u6b65\u9aa4\u90fd\u662f\u76f8\u4f3c\u7684\uff1a\u521b\u5efa\u6587\u4ef6\u3001\u7f16\u5199\u4ee3\u7801\u3001\u4fdd\u5b58\u6587\u4ef6\u548c\u8fd0\u884c\u4ee3\u7801\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u4fdd\u5b58\u548c\u7ba1\u7406\u4f60\u7684Python\u4ee3\u7801\uff0c\u63d0\u9ad8\u7f16\u5199\u4ee3\u7801\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06\u7f16\u8f91\u597d\u7684Python\u4ee3\u7801\u4fdd\u5b58\u4e3a\u6587\u4ef6\uff1f<\/strong><br \/>\u5728\u7f16\u8f91Python\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VS Code\u3001PyCharm\u6216Sublime Text\uff09\u5c06\u4ee3\u7801\u4fdd\u5b58\u4e3a.py\u683c\u5f0f\u7684\u6587\u4ef6\u3002\u53ea\u9700\u70b9\u51fb\u201c\u6587\u4ef6\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u4fdd\u5b58\u201d\u6216\u201c\u53e6\u5b58\u4e3a\u201d\uff0c\u7136\u540e\u8f93\u5165\u6587\u4ef6\u540d\u5e76\u9009\u62e9\u6587\u4ef6\u7c7b\u578b\u4e3aPython (.py)\u3002<\/p>\n<p><strong>Python\u4ee3\u7801\u4fdd\u5b58\u540e\uff0c\u5982\u4f55\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\uff1f<\/strong><br \/>\u4fdd\u5b58Python\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\uff08\u547d\u4ee4\u63d0\u793a\u7b26\uff09\uff0c\u5e76\u5bfc\u822a\u5230\u4ee3\u7801\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002\u4f7f\u7528\u547d\u4ee4<code>python \u6587\u4ef6\u540d.py<\/code>\uff08\u5728Windows\u4e0a\uff09\u6216<code>python3 \u6587\u4ef6\u540d.py<\/code>\uff08\u5728Mac\u6216Linux\u4e0a\uff09\u6765\u8fd0\u884c\u8be5\u6587\u4ef6\u3002\u786e\u4fdd\u5df2\u5b89\u88c5Python\uff0c\u5e76\u4e14\u73af\u5883\u53d8\u91cf\u5df2\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u60f3\u5b9a\u671f\u4fdd\u5b58\u6211\u7684Python\u9879\u76ee\uff0c\u6709\u4ec0\u4e48\u597d\u7684\u65b9\u6cd5\u5417\uff1f<\/strong><br \/>\u4f7f\u7528\u7248\u672c\u63a7\u5236\u5de5\u5177\uff08\u5982Git\uff09\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5b9a\u671f\u4fdd\u5b58\u548c\u7ba1\u7406Python\u9879\u76ee\u7684\u66f4\u6539\u3002Git\u5141\u8bb8\u4f60\u521b\u5efa\u4ee3\u7801\u7684\u4e0d\u540c\u7248\u672c\uff0c\u65b9\u4fbf\u8ffd\u8e2a\u548c\u6062\u590d\u5148\u524d\u7684\u72b6\u6001\u3002\u4f60\u53ef\u4ee5\u5c06\u4ee3\u7801\u63a8\u9001\u5230GitHub\u7b49\u5e73\u53f0\uff0c\u786e\u4fdd\u4f60\u7684\u5de5\u4f5c\u4e0d\u4f1a\u4e22\u5931\uff0c\u5e76\u4fbf\u4e8e\u4e0e\u4ed6\u4eba\u534f\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4fdd\u5b58\u81ea\u5df1\u7f16\u8f91\u7684Python\u4ee3\u7801\u6709\u591a\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u547d\u4ee4\u884c\u4fdd\u5b58\u3001\u6587\u672c\u7f16\u8f91\u5668\u4fdd\u5b58\u3002\u6211\u4eec\u5c06\u5728\u672c\u6587 [&hellip;]","protected":false},"author":3,"featured_media":1081764,"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\/1081753"}],"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=1081753"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1081753\/revisions"}],"predecessor-version":[{"id":1081770,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1081753\/revisions\/1081770"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1081764"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1081753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1081753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1081753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}