{"id":1044099,"date":"2024-12-31T13:11:38","date_gmt":"2024-12-31T05:11:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1044099.html"},"modified":"2024-12-31T13:11:41","modified_gmt":"2024-12-31T05:11:41","slug":"%e7%94%a8%e7%bc%96%e8%be%91%e5%99%a8%e5%86%99%e4%ba%86python%e5%a6%82%e4%bd%95%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1044099.html","title":{"rendered":"\u7528\u7f16\u8f91\u5668\u5199\u4e86python\u5982\u4f55\u8fd0\u884c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/95274c4d-1f3e-4b40-91dc-d3082238d02d.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u7528\u7f16\u8f91\u5668\u5199\u4e86python\u5982\u4f55\u8fd0\u884c\" \/><\/p>\n<p><p> <strong>\u7528\u7f16\u8f91\u5668\u5199\u4e86Python\u4ee3\u7801\u540e\uff0c\u5982\u4f55\u8fd0\u884c\uff1f<\/strong><br \/><strong>\u4fdd\u5b58\u4e3a.py\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c\u3001\u4f7f\u7528IDE\u7684\u8fd0\u884c\u6309\u94ae\u3001\u901a\u8fc7\u811a\u672c\u89e3\u91ca\u5668\u8fd0\u884c\u3002<\/strong><br \/>\u5176\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c\u662f\u4e00\u79cd\u5e38\u89c1\u4e14\u7075\u6d3b\u7684\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5Python\u89e3\u91ca\u5668\uff0c\u7136\u540e\u5728\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u7f16\u5199\u5e76\u4fdd\u5b58Python\u4ee3\u7801\u6587\u4ef6\uff0c\u63a5\u7740\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fdb\u5165\u6587\u4ef6\u6240\u5728\u76ee\u5f55\uff0c\u8f93\u5165\u201cpython \u6587\u4ef6\u540d.py\u201d\u5373\u53ef\u8fd0\u884c\u8be5Python\u811a\u672c\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u53ef\u4ee5\u65b9\u4fbf\u5730\u67e5\u770b\u7a0b\u5e8f\u7684\u8f93\u51fa\u548c\u9519\u8bef\u4fe1\u606f\uff0c\u9002\u5408\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u8fdb\u884c\u8c03\u8bd5\u548c\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5404\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4fdd\u5b58\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u3001IDE\u7b49\u65b9\u5f0f\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4fdd\u5b58\u4e3a.py\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>\u5728\u7f16\u5199Python\u4ee3\u7801\u65f6\uff0c\u9996\u5148\u9700\u8981\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad++\u3001VS Code\u3001Sublime Text\u7b49\uff09\u5c06\u4ee3\u7801\u4fdd\u5b58\u4e3a\u6269\u5c55\u540d\u4e3a.py\u7684\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5982\u679c\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u5c06\u5176\u4fdd\u5b58\u4e3a\u201chello.py\u201d\u3002\u6b64\u65f6\uff0c\u60a8\u5df2\u7ecf\u5b8c\u6210\u4e86\u7b2c\u4e00\u6b65\uff0c\u5373\u521b\u5efa\u4e86\u4e00\u4e2aPython\u811a\u672c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c<\/h2>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff1a<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6309Win+R\u952e\uff0c\u8f93\u5165\u201ccmd\u201d\u5e76\u56de\u8f66\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u5bf9\u4e8emacOS\u548cLinux\u7528\u6237\uff0c\u53ef\u4ee5\u76f4\u63a5\u6253\u5f00\u7ec8\u7aef\uff08Terminal\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u76ee\u5f55\uff1a<\/strong><br \/>\u4f7f\u7528\u201ccd\u201d\u547d\u4ee4\u8fdb\u5165Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679chello.py\u6587\u4ef6\u4fdd\u5b58\u5728\u684c\u9762\u4e0a\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">cd Desktop<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c\uff1a<\/strong><br \/>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5\u7684\u662fPython 3.x\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u201cpython3\u201d\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3 hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u6210\u529f\u540e\uff0c\u60a8\u5c06\u770b\u5230\u547d\u4ee4\u884c\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u4e09\u3001\u4f7f\u7528IDE\u7684\u8fd0\u884c\u6309\u94ae<\/h2>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u914d\u7f6eIDE\uff1a<\/strong><br \/>\u5b89\u88c5\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u5982PyCharm\u3001VS Code\u3001Jupyter Notebook\u7b49\u3002\u786e\u4fdd\u5df2\u6b63\u786e\u914d\u7f6ePython\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00Python\u811a\u672c\uff1a<\/strong><br \/>\u5728IDE\u4e2d\u6253\u5f00\u60a8\u4fdd\u5b58\u7684Python\u811a\u672c\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5728PyCharm\u4e2d\uff0c\u53ef\u4ee5\u9009\u62e9\u201cFile\u201d -&gt; \u201cOpen\u201d\u5e76\u5bfc\u822a\u5230\u201chello.py\u201d\u6587\u4ef6\u6240\u5728\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c\uff1a<\/strong><br \/>\u901a\u8fc7\u70b9\u51fbIDE\u4e2d\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff08\u901a\u5e38\u662f\u7eff\u8272\u7684\u4e09\u89d2\u5f62\u56fe\u6807\uff09\u8fd0\u884c\u811a\u672c\u3002IDE\u4f1a\u81ea\u52a8\u5728\u5185\u7f6e\u7ec8\u7aef\u4e2d\u6267\u884cPython\u4ee3\u7801\uff0c\u5e76\u663e\u793a\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u56db\u3001\u901a\u8fc7\u811a\u672c\u89e3\u91ca\u5668\u8fd0\u884c<\/h2>\n<\/p>\n<ol>\n<li>\n<p><strong>\u76f4\u63a5\u8fd0\u884c\u89e3\u91ca\u5668\uff1a<\/strong><br \/>\u5982\u679c\u60a8\u53ea\u9700\u8981\u8fd0\u884c\u4e00\u5c0f\u6bb5Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u542f\u52a8Python\u89e3\u91ca\u5668\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Python\u89e3\u91ca\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\uff1a<\/strong><br \/>\u5728Python\u89e3\u91ca\u5668\u63d0\u793a\u7b26\uff08&gt;&gt;&gt;\uff09\u4e0b\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u5e76\u56de\u8f66\u6267\u884c\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u89e3\u91ca\u5668\u4f1a\u7acb\u5373\u6267\u884c\u4ee3\u7801\u5e76\u663e\u793a\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u4e94\u3001\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406<\/h2>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u811a\u672c\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u548c\u5f02\u5e38\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bed\u6cd5\u9519\u8bef\uff1a<\/strong><br \/>\u8bed\u6cd5\u9519\u8bef\u901a\u5e38\u662f\u5728\u7f16\u5199\u4ee3\u7801\u65f6\u51fa\u73b0\u7684\u62fc\u5199\u6216\u683c\u5f0f\u9519\u8bef\u3002Python\u89e3\u91ca\u5668\u4f1a\u5728\u8fd0\u884c\u65f6\u68c0\u6d4b\u5230\u8fd9\u4e9b\u9519\u8bef\uff0c\u5e76\u663e\u793a\u9519\u8bef\u4fe1\u606f\u548c\u884c\u53f7\u3002\u68c0\u67e5\u5e76\u4fee\u6b63\u4ee3\u7801\u4e2d\u7684\u8bed\u6cd5\u9519\u8bef\uff0c\u91cd\u65b0\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u65f6\u9519\u8bef\uff1a<\/strong><br \/>\u8fd0\u884c\u65f6\u9519\u8bef\u662f\u5728\u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u9519\u8bef\uff0c\u5982\u9664\u96f6\u9519\u8bef\u3001\u7d22\u5f15\u8d85\u51fa\u8303\u56f4\u7b49\u3002Python\u89e3\u91ca\u5668\u4f1a\u663e\u793a\u9519\u8bef\u7c7b\u578b\u548c\u5806\u6808\u8ddf\u8e2a\u4fe1\u606f\uff0c\u5e2e\u52a9\u60a8\u5b9a\u4f4d\u9519\u8bef\u4f4d\u7f6e\u3002\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u6216\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u8c03\u8bd5\u4fe1\u606f\uff0c\u9010\u6b65\u6392\u67e5\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u903b\u8f91\u9519\u8bef\uff1a<\/strong><br \/>\u903b\u8f91\u9519\u8bef\u662f\u6307\u7a0b\u5e8f\u8fd0\u884c\u6b63\u5e38\u4f46\u8f93\u51fa\u7ed3\u679c\u4e0d\u7b26\u5408\u9884\u671f\u3002\u6b64\u7c7b\u9519\u8bef\u901a\u5e38\u96be\u4ee5\u68c0\u6d4b\uff0c\u9700\u8981\u4ed4\u7ec6\u68c0\u67e5\u4ee3\u7801\u903b\u8f91\u548c\u7b97\u6cd5\u3002\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\uff08\u5982\u65ad\u70b9\u8c03\u8bd5\uff09\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u5e76\u89c2\u5bdf\u53d8\u91cf\u503c\u548c\u7a0b\u5e8f\u6d41\u7a0b\uff0c\u627e\u51fa\u5e76\u4fee\u6b63\u903b\u8f91\u9519\u8bef\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u516d\u3001\u4f18\u5316\u548c\u63d0\u5347\u4ee3\u7801\u6027\u80fd<\/h2>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u811a\u672c\u540e\uff0c\u5982\u679c\u53d1\u73b0\u6027\u80fd\u4e0d\u4f73\u6216\u6267\u884c\u901f\u5ea6\u8f83\u6162\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u4f18\u5316\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f18\u5316\u7b97\u6cd5\u548c\u6570\u636e\u7ed3\u6784\uff1a<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u7b97\u6cd5\u548c\u6570\u636e\u7ed3\u6784\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u7a0b\u5e8f\u6027\u80fd\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u54c8\u5e0c\u8868\u4ee3\u66ff\u5217\u8868\u8fdb\u884c\u67e5\u627e\u64cd\u4f5c\uff0c\u6216\u4f7f\u7528\u5feb\u901f\u6392\u5e8f\u4ee3\u66ff\u5192\u6ce1\u6392\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\uff1a<\/strong><br \/>\u5c3d\u91cf\u51cf\u5c11\u91cd\u590d\u8ba1\u7b97\u548c\u5197\u4f59\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5c06\u5faa\u73af\u5916\u7684\u5e38\u91cf\u8ba1\u7b97\u63d0\u524d\uff0c\u907f\u514d\u5728\u5faa\u73af\u4e2d\u91cd\u590d\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u548c\u5e93\uff1a<\/strong><br \/>Python\u5185\u7f6e\u51fd\u6570\u548c\u6807\u51c6\u5e93\u901a\u5e38\u7ecf\u8fc7\u4f18\u5316\uff0c\u6027\u80fd\u8f83\u597d\u3002\u5c3d\u91cf\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u548c\u5e93\u51fd\u6570\u4ee3\u66ff\u81ea\u5b9a\u4e49\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c\u4f7f\u7528sum()\u51fd\u6570\u8ba1\u7b97\u5217\u8868\u5143\u7d20\u548c\uff0c\u6027\u80fd\u4f18\u4e8e\u5faa\u73af\u7d2f\u52a0\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5e76\u884c\u548c\u5e76\u53d1\u7f16\u7a0b\uff1a<\/strong><br \/>\u5bf9\u4e8e\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u591a\u7ebf\u7a0b\u3001\u591a\u8fdb\u7a0b\u6216\u5f02\u6b65\u7f16\u7a0b\u63d0\u9ad8\u6027\u80fd\u3002Python\u7684threading\u3001multiprocessing\u548casyncio\u6a21\u5757\u63d0\u4f9b\u4e86\u5e76\u884c\u548c\u5e76\u53d1\u7f16\u7a0b\u652f\u6301\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u4e03\u3001\u90e8\u7f72\u548c\u53d1\u5e03Python\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u548c\u6d4b\u8bd5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5c06Python\u811a\u672c\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u6216\u53d1\u5e03\u7ed9\u5176\u4ed6\u7528\u6237\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u90e8\u7f72\u548c\u53d1\u5e03\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5305\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/strong><br \/>\u4f7f\u7528PyInstaller\u3001cx_Freeze\u7b49\u5de5\u5177\u5c06Python\u811a\u672c\u6253\u5305\u4e3a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4fbf\u4e8e\u53d1\u5e03\u548c\u5206\u53d1\u3002\u4f8b\u5982\uff0c\u4f7f\u7528PyInstaller\u6253\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pyinstaller --onefile hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u76f4\u63a5\u8fd0\u884c\uff0c\u65e0\u9700\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u90e8\u7f72\u5230\u670d\u52a1\u5668\uff1a<\/strong><br \/>\u5982\u679c\u9700\u8981\u5c06Python\u811a\u672c\u90e8\u7f72\u5230\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\uff0c\u53ef\u4ee5\u9009\u62e9\u4e91\u670d\u52a1\uff08\u5982AWS\u3001Azure\u3001Google Cloud\uff09\u6216\u81ea\u5efa\u670d\u52a1\u5668\u3002\u5c06\u811a\u672c\u4e0a\u4f20\u5230\u670d\u52a1\u5668\uff0c\u5e76\u914d\u7f6e\u76f8\u5e94\u7684\u73af\u5883\u548c\u4f9d\u8d56\u3002\u4f7f\u7528\u8c03\u5ea6\u5de5\u5177\uff08\u5982cron\uff09\u5b9a\u65f6\u8fd0\u884c\u811a\u672c\uff0c\u6216\u4f7f\u7528Web\u6846\u67b6\uff08\u5982Django\u3001Flask\uff09\u6784\u5efaWeb\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53d1\u5e03\u5230Python\u5305\u7ba1\u7406\u5668\uff1a<\/strong><br \/>\u5982\u679c\u5e0c\u671b\u5c06Python\u811a\u672c\u53d1\u5e03\u4e3a\u53ef\u91cd\u7528\u7684\u5e93\uff0c\u53ef\u4ee5\u5c06\u5176\u6253\u5305\u5e76\u53d1\u5e03\u5230Python\u5305\u7ba1\u7406\u5668\uff08\u5982PyPI\uff09\u3002\u7f16\u5199setup.py\u6587\u4ef6\uff0c\u5b9a\u4e49\u5305\u7684\u5143\u6570\u636e\u548c\u4f9d\u8d56\u9879\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53d1\u5e03\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python setup.py sdist bdist_wheel<\/p>\n<p>twine upload dist\/*<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u53d1\u5e03\u6210\u529f\u540e\uff0c\u5176\u4ed6\u7528\u6237\u53ef\u4ee5\u901a\u8fc7pip\u5b89\u88c5\u548c\u4f7f\u7528\u60a8\u7684\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u8fd0\u884c\u3001\u8c03\u8bd5\u3001\u4f18\u5316\u548c\u90e8\u7f72Python\u811a\u672c\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u60a8\u5728Python\u7f16\u7a0b\u4e4b\u65c5\u4e2d\u53d6\u5f97\u6210\u529f\uff01<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u7f16\u8f91\u5668\u4e2d\u8fd0\u884cPython\u4ee3\u7801\uff1f<\/strong><br \/>\u8981\u5728\u7f16\u8f91\u5668\u4e2d\u8fd0\u884cPython\u4ee3\u7801\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u6253\u5f00\u60a8\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff08\u5982VSCode\u3001PyCharm\u6216Sublime Text\uff09\uff0c\u7f16\u5199\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u7f16\u8f91\u5668\u63d0\u4f9b\u7684\u8fd0\u884c\u6309\u94ae\uff0c\u6216\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python \u6587\u4ef6\u540d.py<\/code>\u547d\u4ee4\u6765\u6267\u884c\u60a8\u7684\u4ee3\u7801\u3002\u786e\u8ba4\u60a8\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u6b63\u786e\uff0c\u4ee5\u4fbf\u7ec8\u7aef\u80fd\u591f\u8bc6\u522bPython\u547d\u4ee4\u3002<\/p>\n<p><strong>\u6211\u8be5\u9009\u62e9\u54ea\u4e2a\u7f16\u8f91\u5668\u6765\u7f16\u5199Python\u4ee3\u7801\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u7f16\u8f91\u5668\u53d6\u51b3\u4e8e\u60a8\u7684\u4e2a\u4eba\u504f\u597d\u548c\u9700\u6c42\u3002\u5e38\u7528\u7684Python\u7f16\u8f91\u5668\u5305\u62ecPyCharm\u3001VSCode\u3001Jupyter Notebook\u7b49\u3002PyCharm\u63d0\u4f9b\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u9002\u5408\u5927\u578b\u9879\u76ee\uff1bVSCode\u8f7b\u91cf\u4e14\u53ef\u6269\u5c55\uff0c\u9002\u5408\u591a\u79cd\u8bed\u8a00\uff1bJupyter Notebook\u5219\u975e\u5e38\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c\u5206\u6790\uff0c\u652f\u6301\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/p>\n<p><strong>\u5982\u4f55\u89e3\u51b3\u5728\u7f16\u8f91\u5668\u4e2d\u8fd0\u884cPython\u65f6\u51fa\u73b0\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u5982\u679c\u5728\u7f16\u8f91\u5668\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u65f6\u9047\u5230\u9519\u8bef\uff0c\u53ef\u4ee5\u68c0\u67e5\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a\u9996\u5148\uff0c\u786e\u8ba4Python\u89e3\u91ca\u5668\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\uff1b\u5176\u6b21\uff0c\u4ed4\u7ec6\u67e5\u770b\u9519\u8bef\u4fe1\u606f\uff0c\u901a\u5e38\u80fd\u63d0\u4f9b\u95ee\u9898\u6240\u5728\u7684\u7ebf\u7d22\uff1b\u6700\u540e\uff0c\u786e\u4fdd\u60a8\u7684\u4ee3\u7801\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u5e76\u4e14\u6240\u6709\u9700\u8981\u7684\u5e93\u90fd\u5df2\u7ecf\u5b89\u88c5\u3002\u5982\u679c\u4ecd\u7136\u65e0\u6cd5\u89e3\u51b3\uff0c\u53ef\u4ee5\u8003\u8651\u5728\u7f51\u4e0a\u67e5\u627e\u9519\u8bef\u4fe1\u606f\u6216\u5728\u7f16\u7a0b\u793e\u533a\u4e2d\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u7528\u7f16\u8f91\u5668\u5199\u4e86Python\u4ee3\u7801\u540e\uff0c\u5982\u4f55\u8fd0\u884c\uff1f\u4fdd\u5b58\u4e3a.py\u6587\u4ef6\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c\u3001\u4f7f\u7528IDE\u7684\u8fd0\u884c\u6309\u94ae\u3001\u901a\u8fc7\u811a [&hellip;]","protected":false},"author":3,"featured_media":1044104,"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\/1044099"}],"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=1044099"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1044099\/revisions"}],"predecessor-version":[{"id":1044105,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1044099\/revisions\/1044105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1044104"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1044099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1044099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1044099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}