{"id":954323,"date":"2024-12-27T01:55:35","date_gmt":"2024-12-26T17:55:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/954323.html"},"modified":"2024-12-27T01:55:38","modified_gmt":"2024-12-26T17:55:38","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python%e7%a8%8b%e5%ba%8f%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/954323.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528python\u7a0b\u5e8f\u8fd0\u884c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25094551\/52cd6fd4-aeef-49b5-b002-87679c06a017.webp\" alt=\"\u5982\u4f55\u4f7f\u7528python\u7a0b\u5e8f\u8fd0\u884c\" \/><\/p>\n<p><p> \u4e00\u3001\u5982\u4f55\u4f7f\u7528Python\u7a0b\u5e8f\u8fd0\u884c<\/p>\n<\/p>\n<p><p><strong>\u8981\u4f7f\u7528Python\u7a0b\u5e8f\u8fd0\u884c\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u9009\u62e9\u5408\u9002\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u7f16\u5199Python\u811a\u672c\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u6216IDE\u8fd0\u884c\u811a\u672c\u3002<\/strong>\u5176\u4e2d\uff0c\u5b89\u88c5Python\u89e3\u91ca\u5668\u662f\u57fa\u7840\uff0c\u9009\u62e9\u5408\u9002\u7684IDE\u53ef\u4ee5\u63d0\u5347\u7f16\u7a0b\u6548\u7387\u3002Python\u89e3\u91ca\u5668\u662f\u6267\u884cPython\u4ee3\u7801\u7684\u5173\u952e\uff0c\u901a\u5e38\u4f1a\u5b89\u88c5Python\u7684\u5b98\u65b9\u7248\u672c\uff0c\u7136\u540e\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Python\u547d\u4ee4\u3002\u9009\u62e9\u5408\u9002\u7684IDE\uff0c\u5982PyCharm\u3001VS Code\u6216Jupyter Notebook\uff0c\u53ef\u4ee5\u63d0\u4f9b\u4e30\u5bcc\u7684\u529f\u80fd\u652f\u6301\uff0c\u6bd4\u5982\u4ee3\u7801\u8865\u5168\u3001\u8c03\u8bd5\u7b49\uff0c\u4ece\u800c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u89e3\u91ca\u5668\u662f\u4f7f\u7528Python\u7a0b\u5e8f\u7684\u7b2c\u4e00\u6b65\u3002Python\u662f\u4e00\u79cd\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u89e3\u91ca\u5668\u662f\u5176\u8fd0\u884c\u7684\u6838\u5fc3\u3002\u7528\u6237\u53ef\u4ee5\u4ecePython\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u5408\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\uff0c\u901a\u5e38\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u4ee5\u83b7\u5f97\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u66f4\u65b0\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u9009\u62e9\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684PATH\u4e2d\uff0c\u8fd9\u4e00\u6b65\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\uff0c\u800c\u4e0d\u5fc5\u624b\u52a8\u6307\u5b9aPython\u7684\u8def\u5f84\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6765\u786e\u8ba4\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5b89\u88c5Python\u89e3\u91ca\u5668<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u89e3\u91ca\u5668\u662f\u4f7f\u7528Python\u8fdb\u884c\u7f16\u7a0b\u7684\u7b2c\u4e00\u6b65\uff0c\u5b83\u51b3\u5b9a\u4e86\u4f60\u80fd\u5426\u6210\u529f\u8fd0\u884cPython\u4ee3\u7801\u3002Python\u662f\u4e00\u79cd\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u5fc5\u987b\u4f9d\u8d56\u89e3\u91ca\u5668\u6765\u6267\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u548c\u5b89\u88c5<\/strong><br \/>\u9996\u5148\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\uff0c\u5728Downloads\u9875\u9762\u4e2d\u9009\u62e9\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u4e0b\u8f7d\u3002\u5efa\u8bae\u9009\u62e9\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u4ee5\u786e\u4fdd\u83b7\u5f97\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u66f4\u65b0\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u52a1\u5fc5\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u5c06Python\u81ea\u52a8\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u65b9\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u884c\uff08Windows\u7528\u6237\u53ef\u4ee5\u4f7f\u7528cmd\uff0cmacOS\u548cLinux\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff09\uff0c\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u67e5\u770bPython\u7248\u672c\u4fe1\u606f\u3002\u5982\u679c\u663e\u793a\u51fa\u7248\u672c\u53f7\uff0c\u8bf4\u660ePython\u5b89\u88c5\u6210\u529f\u3002\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165<code>pip --version<\/code>\u6765\u68c0\u67e5pip\u662f\u5426\u6b63\u786e\u5b89\u88c5\uff0cpip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u9009\u62e9\u5408\u9002\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u662f\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u4e00\u4e2a\u597d\u7684IDE\u53ef\u4ee5\u63d0\u9ad8\u7f16\u7a0b\u6548\u7387\uff0c\u63d0\u4f9b\u4ee3\u7801\u8865\u5168\u3001\u8bed\u6cd5\u9ad8\u4eae\u3001\u8c03\u8bd5\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>PyCharm<\/strong><br \/>PyCharm\u662f\u7531JetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u5f00\u53d1\u7684\u4e00\u6b3e\u4e13\u4e1aPython IDE\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u652f\u6301\uff0c\u5982\u4ee3\u7801\u8865\u5168\u3001\u667a\u80fd\u9519\u8bef\u68c0\u6d4b\u3001\u8c03\u8bd5\u5de5\u5177\u7b49\u3002\u5b83\u6709\u4e24\u4e2a\u7248\u672c\uff1a\u793e\u533a\u7248\u548c\u4e13\u4e1a\u7248\uff0c\u793e\u533a\u7248\u662f\u514d\u8d39\u7684\uff0c\u9002\u5408\u5927\u591a\u6570Python\u5f00\u53d1\u9700\u6c42\u3002PyCharm\u652f\u6301\u591a\u79cdPython\u6846\u67b6\uff0c\u5982Django\u3001Flask\u7b49\uff0c\u975e\u5e38\u9002\u5408\u5f00\u53d1\u5927\u578b\u9879\u76ee\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>VS Code<\/strong><br \/>Visual Studio Code\uff08VS Code\uff09\u662f\u5fae\u8f6f\u63a8\u51fa\u7684\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u7f16\u8f91\u5668\u3002\u901a\u8fc7\u5b89\u88c5Python\u6269\u5c55\u63d2\u4ef6\uff0cVS Code\u53ef\u4ee5\u63d0\u4f9b\u7c7b\u4f3cIDE\u7684\u529f\u80fd\u652f\u6301\u3002\u5b83\u7684\u4f18\u52bf\u5728\u4e8e\u8f7b\u91cf\u7ea7\u3001\u63d2\u4ef6\u4e30\u5bcc\u3001\u8de8\u5e73\u53f0\u652f\u6301\u597d\uff0c\u9002\u5408\u9700\u8981\u591a\u8bed\u8a00\u5f00\u53d1\u7684\u7a0b\u5e8f\u5458\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Jupyter Notebook<\/strong><br \/>Jupyter Notebook\u662f\u4e00\u79cd\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u79d1\u5b66\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u9886\u57df\u3002\u5b83\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u6587\u6863\u4e2d\u540c\u65f6\u5305\u542b\u4ee3\u7801\u3001\u6587\u672c\u3001\u516c\u5f0f\u548c\u56fe\u8868\uff0c\u662f\u8fdb\u884c\u6570\u636e\u5206\u6790\u3001\u6570\u636e\u53ef\u89c6\u5316\u548c\u5b66\u672f\u7814\u7a76\u7684\u7406\u60f3\u5de5\u5177\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u7f16\u5199Python\u811a\u672c<\/p>\n<\/p>\n<p><p>\u7f16\u5199Python\u811a\u672c\u662f\u4f7f\u7528Python\u7a0b\u5e8f\u7684\u6838\u5fc3\u90e8\u5206\u3002Python\u811a\u672c\u662f\u4e00\u79cd\u5305\u542bPython\u4ee3\u7801\u7684\u6587\u672c\u6587\u4ef6\uff0c\u901a\u5e38\u4ee5<code>.py<\/code>\u4e3a\u6269\u5c55\u540d\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u57fa\u7840\u8bed\u6cd5<\/strong><br \/>Python\u7684\u8bed\u6cd5\u7b80\u5355\u6613\u5b66\uff0c\u5f3a\u8c03\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u3002Python\u4f7f\u7528\u7f29\u8fdb\u6765\u8868\u793a\u4ee3\u7801\u5757\uff0c\u8fd9\u4e0e\u5176\u4ed6\u8bed\u8a00\u4f7f\u7528\u5927\u62ec\u53f7\u4e0d\u540c\u3002\u53d8\u91cf\u4e0d\u9700\u8981\u58f0\u660e\u7c7b\u578b\uff0cPython\u4f1a\u6839\u636e\u8d4b\u503c\u81ea\u52a8\u63a8\u65ad\u53d8\u91cf\u7c7b\u578b\u3002Python\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5982\u6570\u5b57\u3001\u5b57\u7b26\u4e32\u3001\u5217\u8868\u3001\u5b57\u5178\u7b49\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u8f7b\u677e\u8fdb\u884c\u6570\u636e\u5904\u7406\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u7b2c\u4e00\u4e2aPython\u811a\u672c<\/strong><br \/>\u6253\u5f00\u4f60\u9009\u62e9\u7684IDE\uff0c\u65b0\u5efa\u4e00\u4e2aPython\u6587\u4ef6\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\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>\u4fdd\u5b58\u6587\u4ef6\uff0c\u901a\u5e38\u4ee5<code>.py<\/code>\u4e3a\u6269\u5c55\u540d\uff0c\u4f8b\u5982<code>hello.py<\/code>\u3002\u8fd9\u6bb5\u7b80\u5355\u7684\u4ee3\u7801\u4f1a\u5728\u8fd0\u884c\u65f6\u8f93\u51fa\u201cHello, World!\u201d\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u6216IDE\u8fd0\u884c\u811a\u672c<\/p>\n<\/p>\n<p><p>\u8fd0\u884cPython\u811a\u672c\u662f\u9a8c\u8bc1\u4ee3\u7801\u6b63\u786e\u6027\u7684\u91cd\u8981\u6b65\u9aa4\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6216IDE\u6765\u5b8c\u6210\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u547d\u4ee4\u884c\u8fd0\u884c<\/strong><br \/>\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5305\u542bPython\u811a\u672c\u7684\u76ee\u5f55\u3002\u8f93\u5165<code>python filename.py<\/code>\u6216<code>python3 filename.py<\/code>\uff08\u6839\u636e\u4f60\u7684Python\u7248\u672c\uff09\uff0c\u4f8b\u5982<code>python hello.py<\/code>\uff0c\u6309\u4e0b\u56de\u8f66\u952e\uff0cPython\u89e3\u91ca\u5668\u4f1a\u6267\u884c\u811a\u672c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>IDE\u8fd0\u884c<\/strong><br \/>\u5728IDE\u4e2d\u6253\u5f00Python\u811a\u672c\u6587\u4ef6\uff0c\u901a\u5e38IDE\u4f1a\u63d0\u4f9b\u4e00\u4e2a\u8fd0\u884c\u6309\u94ae\uff0c\u4f60\u53ef\u4ee5\u70b9\u51fb\u8be5\u6309\u94ae\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u3002IDE\u4f1a\u5728\u63a7\u5236\u53f0\u6216\u8f93\u51fa\u7a97\u53e3\u4e2d\u663e\u793a\u811a\u672c\u7684\u6267\u884c\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u76f4\u63a5\u5728\u5f00\u53d1\u73af\u5883\u4e2d\u8c03\u8bd5\u548c\u6d4b\u8bd5\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406<\/p>\n<\/p>\n<p><p>\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406\u662f\u7f16\u5199Python\u7a0b\u5e8f\u7684\u5173\u952e\u6b65\u9aa4\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u8bc6\u522b\u548c\u4fee\u590d\u4ee3\u7801\u4e2d\u7684\u9519\u8bef\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8c03\u8bd5\u6280\u5de7<\/strong><br \/>IDE\u901a\u5e38\u63d0\u4f9b\u8c03\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u89c2\u5bdf\u53d8\u91cf\u7684\u53d8\u5316\u3002\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u627e\u5230\u4ee3\u7801\u4e2d\u7684\u903b\u8f91\u9519\u8bef\u548c\u5f02\u5e38\u3002\u638c\u63e1\u8c03\u8bd5\u6280\u5de7\u662f\u6210\u4e3a\u9ad8\u6548\u7a0b\u5e8f\u5458\u7684\u91cd\u8981\u80fd\u529b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9519\u8bef\u5904\u7406<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u5f02\u5e38\u5904\u7406\u673a\u5236\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try<\/code>\u3001<code>except<\/code>\u8bed\u53e5\u6765\u6355\u83b7\u548c\u5904\u7406\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u5f02\u5e38\u3002\u901a\u8fc7\u5408\u7406\u7684\u9519\u8bef\u5904\u7406\uff0c\u53ef\u4ee5\u4f7f\u7a0b\u5e8f\u5728\u53d1\u751f\u9519\u8bef\u65f6\u4e0d\u81f3\u4e8e\u5d29\u6e83\uff0c\u5e76\u63d0\u4f9b\u6709\u610f\u4e49\u7684\u9519\u8bef\u4fe1\u606f\u6216\u8fdb\u884c\u9002\u5f53\u7684\u8865\u6551\u63aa\u65bd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e03\u3001\u4f7f\u7528Python\u5e93\u548c\u6a21\u5757<\/p>\n<\/p>\n<p><p>Python\u7684\u5f3a\u5927\u4e4b\u5904\u5728\u4e8e\u5176\u4e30\u5bcc\u7684\u6807\u51c6\u5e93\u548c\u7b2c\u4e09\u65b9\u5e93\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u5feb\u901f\u5b9e\u73b0\u5404\u79cd\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6807\u51c6\u5e93<\/strong><br \/>Python\u7684\u6807\u51c6\u5e93\u5305\u542b\u4e86\u8bb8\u591a\u5b9e\u7528\u6a21\u5757\uff0c\u5982<code>os<\/code>\u3001<code>sys<\/code>\u3001<code>datetime<\/code>\u7b49\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5b8c\u6210\u6587\u4ef6\u64cd\u4f5c\u3001\u7cfb\u7edf\u8c03\u7528\u3001\u65e5\u671f\u65f6\u95f4\u5904\u7406\u7b49\u4efb\u52a1\u3002\u5b66\u4e60\u4f7f\u7528\u6807\u51c6\u5e93\u53ef\u4ee5\u63d0\u9ad8\u7f16\u7a0b\u6548\u7387\uff0c\u51cf\u5c11\u91cd\u590d\u9020\u8f6e\u5b50\u7684\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7b2c\u4e09\u65b9\u5e93<\/strong><br \/>\u901a\u8fc7pip\u53ef\u4ee5\u5b89\u88c5\u548c\u7ba1\u7406\u7b2c\u4e09\u65b9\u5e93\uff0c\u4f8b\u5982<code>numpy<\/code>\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\uff0c<code>pandas<\/code>\u7528\u4e8e\u6570\u636e\u5206\u6790\uff0c<code>matplotlib<\/code>\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u3002\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u5f00\u53d1\u8fc7\u7a0b\uff0c\u52a0\u5feb\u9879\u76ee\u8fdb\u5ea6\u3002\u5728\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u65f6\uff0c\u6ce8\u610f\u67e5\u770b\u5e93\u7684\u6587\u6863\u548c\u7248\u672c\u8981\u6c42\uff0c\u4ee5\u786e\u4fdd\u5176\u517c\u5bb9\u6027\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516b\u3001\u7248\u672c\u63a7\u5236\u548c\u534f\u4f5c\u5f00\u53d1<\/p>\n<\/p>\n<p><p>\u7248\u672c\u63a7\u5236\u662f\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u90e8\u5206\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u7ba1\u7406\u4ee3\u7801\u7684\u4e0d\u540c\u7248\u672c\uff0c\u534f\u4f5c\u5f00\u53d1\u80fd\u591f\u63d0\u9ad8\u56e2\u961f\u7684\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Git\u548cGitHub<\/strong><br \/>Git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u80fd\u591f\u8bb0\u5f55\u4ee3\u7801\u7684\u6bcf\u6b21\u66f4\u6539\uff0c\u65b9\u4fbf\u4f60\u56de\u6eda\u5230\u4e4b\u524d\u7684\u7248\u672c\u3002GitHub\u662f\u4e00\u4e2a\u57fa\u4e8eGit\u7684\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\uff0c\u652f\u6301\u4ee3\u7801\u4ed3\u5e93\u7684\u521b\u5efa\u3001\u7ba1\u7406\u548c\u534f\u4f5c\u5f00\u53d1\u3002\u5b66\u4e60\u4f7f\u7528Git\u548cGitHub\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406\u9879\u76ee\u4ee3\u7801\uff0c\u63d0\u9ad8\u534f\u4f5c\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u534f\u4f5c\u5f00\u53d1<\/strong><br \/>\u5728\u56e2\u961f\u5f00\u53d1\u4e2d\uff0c\u4f7f\u7528\u7248\u672c\u63a7\u5236\u5de5\u5177\u80fd\u591f\u6709\u6548\u5730\u7ba1\u7406\u4ee3\u7801\u5408\u5e76\u548c\u51b2\u7a81\u89e3\u51b3\u3002\u901a\u8fc7Pull Request\u3001<a href=\"https:\/\/docs.pingcode.com\/code-review\" target=\"_blank\">\u4ee3\u7801\u5ba1\u67e5<\/a>\u7b49\u6d41\u7a0b\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\uff0c\u786e\u4fdd\u9879\u76ee\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u638c\u63e1\u534f\u4f5c\u5f00\u53d1\u7684\u6280\u5de7\uff0c\u5bf9\u4e8e\u56e2\u961f\u9879\u76ee\u7684\u6210\u529f\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e5d\u3001\u4f18\u5316\u548c\u6027\u80fd\u8c03\u4f18<\/p>\n<\/p>\n<p><p>\u4f18\u5316\u548c\u6027\u80fd\u8c03\u4f18\u662f\u63d0\u9ad8Python\u7a0b\u5e8f\u8fd0\u884c\u6548\u7387\u7684\u91cd\u8981\u6b65\u9aa4\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u8bc6\u522b\u548c\u6d88\u9664\u6027\u80fd\u74f6\u9888\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4ee3\u7801\u4f18\u5316<\/strong><br \/>\u901a\u8fc7\u5206\u6790\u4ee3\u7801\u7684\u590d\u6742\u5ea6\u3001\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\u3001\u4f7f\u7528\u66f4\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u7b49\u65b9\u6cd5\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002\u5b9a\u671f\u8fdb\u884c\u4ee3\u7801\u5ba1\u67e5\uff0c\u8bc6\u522b\u548c\u4f18\u5316\u6027\u80fd\u74f6\u9888\uff0c\u662f\u4fdd\u6301\u4ee3\u7801\u9ad8\u6548\u8fd0\u884c\u7684\u5173\u952e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6027\u80fd\u8c03\u4f18\u5de5\u5177<\/strong><br \/>\u4f7f\u7528Python\u7684\u6027\u80fd\u8c03\u4f18\u5de5\u5177\uff0c\u5982<code>cProfile<\/code>\u3001<code>line_profiler<\/code>\u7b49\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5206\u6790\u7a0b\u5e8f\u7684\u6027\u80fd\u74f6\u9888\uff0c\u63d0\u4f9b\u8be6\u7ec6\u7684\u6027\u80fd\u62a5\u544a\u3002\u901a\u8fc7\u5206\u6790\u8fd9\u4e9b\u62a5\u544a\uff0c\u53ef\u4ee5\u627e\u5230\u4ee3\u7801\u4e2d\u9700\u8981\u4f18\u5316\u7684\u90e8\u5206\uff0c\u91c7\u53d6\u9002\u5f53\u7684\u4f18\u5316\u63aa\u65bd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5341\u3001\u90e8\u7f72\u548c\u53d1\u5e03Python\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u5c06Python\u5e94\u7528\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\uff0c\u662f\u8ba9\u7a0b\u5e8f\u53d1\u6325\u5b9e\u9645\u4ef7\u503c\u7684\u6700\u540e\u4e00\u6b65\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5305\u548c\u53d1\u5e03<\/strong><br \/>\u4f7f\u7528\u5de5\u5177\u5982<code>pyinstaller<\/code>\u53ef\u4ee5\u5c06Python\u811a\u672c\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4fbf\u4e8e\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u3002\u901a\u8fc7<code>setuptools<\/code>\u53ef\u4ee5\u5c06Python\u5e94\u7528\u53d1\u5e03\u5230Python Package Index\uff08PyPI\uff09\uff0c\u65b9\u4fbf\u5176\u4ed6\u7528\u6237\u4e0b\u8f7d\u548c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u90e8\u7f72\u5230\u670d\u52a1\u5668<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u670d\u52a1\u5668\u548c\u90e8\u7f72\u5e73\u53f0\uff0c\u5982AWS\u3001Heroku\u3001DigitalOcean\u7b49\uff0c\u5c06Python\u5e94\u7528\u90e8\u7f72\u5230\u4e91\u7aef\u3002\u914d\u7f6e\u670d\u52a1\u5668\u73af\u5883\uff0c\u786e\u4fddPython\u7248\u672c\u548c\u4f9d\u8d56\u5e93\u4e0e\u5f00\u53d1\u73af\u5883\u4e00\u81f4\uff0c\u4f7f\u7528\u5de5\u5177\u5982Docker\u53ef\u4ee5\u7b80\u5316\u90e8\u7f72\u8fc7\u7a0b\uff0c\u63d0\u9ad8\u5e94\u7528\u7684\u53ef\u79fb\u690d\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u521d\u5b66\u8005\u53ef\u4ee5\u9010\u6b65\u638c\u63e1\u5982\u4f55\u4f7f\u7528Python\u7a0b\u5e8f\u8fd0\u884c\uff0c\u4ece\u5b89\u88c5\u5230\u90e8\u7f72\uff0c\u6bcf\u4e2a\u73af\u8282\u90fd\u81f3\u5173\u91cd\u8981\u3002\u6301\u7eed\u5b66\u4e60\u548c\u5b9e\u8df5\uff0c\u4e0d\u65ad\u63d0\u5347\u7f16\u7a0b\u6280\u80fd\uff0c\u624d\u80fd\u5728Python\u5f00\u53d1\u4e2d\u6e38\u5203\u6709\u4f59\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u6211\u7684\u7535\u8111\u4e0a\u5b89\u88c5Python\u4ee5\u4fbf\u8fd0\u884c\u7a0b\u5e8f\uff1f<\/strong><br \/>\u8981\u5728\u7535\u8111\u4e0a\u5b89\u88c5Python\uff0c\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u65b9\u4fbf\u5730\u8fd0\u884cPython\u7a0b\u5e8f\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6765\u786e\u8ba4\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>\u6211\u5e94\u8be5\u9009\u62e9\u54ea\u4e2a\u7248\u672c\u7684Python\u6765\u8fd0\u884c\u7a0b\u5e8f\uff1f<\/strong><br \/>\u5efa\u8bae\u9009\u62e9\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u7684Python\uff0c\u901a\u5e38\u662fPython 3.x\u7cfb\u5217\uff0c\u56e0\u4e3a\u8bb8\u591a\u65b0\u5e93\u548c\u6846\u67b6\u90fd\u652f\u6301\u8fd9\u4e00\u7248\u672c\u3002Python 2.x\u7cfb\u5217\u5df2\u4e8e2020\u5e74\u505c\u6b62\u652f\u6301\uff0c\u56e0\u6b64\u5728\u7f16\u5199\u548c\u8fd0\u884c\u65b0\u7684Python\u7a0b\u5e8f\u65f6\uff0c\u9009\u62e9Python 3.x\u5c06\u786e\u4fdd\u60a8\u83b7\u5f97\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u8fd0\u884c\u4e00\u4e2a\u7b80\u5355\u7684\u7a0b\u5e8f\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VS Code\u3001Sublime Text\u6216PyCharm\uff09\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>hello.py<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u4e3a<code>print(&quot;Hello, World!&quot;)<\/code>\u3002\u63a5\u7740\u5728\u547d\u4ee4\u884c\u4e2d\u5bfc\u822a\u5230\u8be5\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u8f93\u5165<code>python hello.py<\/code>\u5373\u53ef\u8fd0\u884c\u8be5\u7a0b\u5e8f\uff0c\u60a8\u4f1a\u5728\u547d\u4ee4\u884c\u4e2d\u770b\u5230\u8f93\u51fa\u7684\u201cHello, World!\u201d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u5982\u4f55\u4f7f\u7528Python\u7a0b\u5e8f\u8fd0\u884c \u8981\u4f7f\u7528Python\u7a0b\u5e8f\u8fd0\u884c\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u9009\u62e9\u5408\u9002\u7684\u96c6\u6210\u5f00 [&hellip;]","protected":false},"author":3,"featured_media":954327,"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\/954323"}],"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=954323"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/954323\/revisions"}],"predecessor-version":[{"id":954328,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/954323\/revisions\/954328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/954327"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=954323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=954323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=954323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}