{"id":1162043,"date":"2025-01-13T19:23:50","date_gmt":"2025-01-13T11:23:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1162043.html"},"modified":"2025-01-13T19:23:53","modified_gmt":"2025-01-13T11:23:53","slug":"%e6%9c%ac%e5%9c%b0%e5%a6%82%e4%bd%95%e8%bf%90%e8%a1%8cpython%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1162043.html","title":{"rendered":"\u672c\u5730\u5982\u4f55\u8fd0\u884cpython\u6587\u4ef6\u8def\u5f84"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25203153\/69e4a083-24d2-4448-8694-98ce43c08fdc.webp\" alt=\"\u672c\u5730\u5982\u4f55\u8fd0\u884cpython\u6587\u4ef6\u8def\u5f84\" \/><\/p>\n<p><p> \u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\u7684\u8def\u5f84\u6709\u591a\u79cd\u65b9\u6cd5\uff0c<strong>\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528IDE\u3001\u4f7f\u7528Python\u4ea4\u4e92\u5f0f\u73af\u5883<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u4f7f\u7528\u547d\u4ee4\u884c<\/strong>\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\uff0c\u4e5f\u662f\u6700\u57fa\u7840\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c<\/h3>\n<\/p>\n<p><h4>1. \u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762<\/h4>\n<\/p>\n<p><p>\u8981\u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\uff0c\u9996\u5148\u9700\u8981\u6253\u5f00\u4f60\u7684\u547d\u4ee4\u884c\u754c\u9762\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u6216\u201cPowerShell\u201d\uff1b\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u201c\u7ec8\u7aef\u201d\u3002<\/p>\n<\/p>\n<p><h4>2. \u5bfc\u822a\u5230Python\u6587\u4ef6\u6240\u5728\u76ee\u5f55<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230Python\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002\u5047\u8bbe\u4f60\u7684Python\u6587\u4ef6\u4f4d\u4e8e<code>C:\\Users\\YourUsername\\Documents\\PythonScripts<\/code>\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">cd C:\\Users\\YourUsername\\Documents\\PythonScripts<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u8fd0\u884cPython\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u76ee\u5f55\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cPython\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 3\uff0c\u6709\u65f6\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3 your_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u8be6\u7ec6\u63cf\u8ff0<\/h4>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884cPython\u6587\u4ef6\u7684\u4e00\u4e2a\u663e\u8457\u4f18\u52bf\u662f\u53ef\u4ee5\u65b9\u4fbf\u5730\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/strong> \u6bd4\u5982\uff0c\u4f60\u53ef\u4ee5\u5728\u8fd0\u884c\u811a\u672c\u65f6\u4f20\u9012\u53c2\u6570\uff0c\u4ee5\u4fbf\u5728\u811a\u672c\u5185\u90e8\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u3002\u5047\u8bbe\u4f60\u7684Python\u811a\u672c\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python your_script.py arg1 arg2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Python\u811a\u672c\u5185\u90e8\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sys.argv<\/code>\u6765\u83b7\u53d6\u8fd9\u4e9b\u53c2\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    arg1 = sys.argv[1]<\/p>\n<p>    arg2 = sys.argv[2]<\/p>\n<p>    print(f&quot;Argument 1: {arg1}&quot;)<\/p>\n<p>    print(f&quot;Argument 2: {arg2}&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u811a\u672c\uff0c\u4e5f\u9002\u7528\u4e8e\u66f4\u590d\u6742\u7684Python\u9879\u76ee\u3002\u901a\u8fc7\u547d\u4ee4\u884c\uff0c\u4f60\u53ef\u4ee5\u7075\u6d3b\u5730\u63a7\u5236\u811a\u672c\u7684\u6267\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528IDE<\/h3>\n<\/p>\n<p><h4>1. \u9009\u62e9\u4e00\u4e2aIDE<\/h4>\n<\/p>\n<p><p>\u6709\u8bb8\u591a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u53ef\u4ee5\u7528\u6765\u8fd0\u884cPython\u6587\u4ef6\uff0c\u6bd4\u5982PyCharm\u3001Visual Studio Code\u3001Spyder\u7b49\u3002\u9009\u62e9\u4e00\u4e2a\u4f60\u559c\u6b22\u7684IDE\u5e76\u5b89\u88c5\u5b83\u3002<\/p>\n<\/p>\n<p><h4>2. \u6253\u5f00\u9879\u76ee\u6216\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5728\u4f60\u7684IDE\u4e2d\u6253\u5f00Python\u9879\u76ee\u6216\u6587\u4ef6\u3002\u901a\u5e38\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201cFile\u201d\u83dc\u5355\u4e2d\u7684\u201cOpen\u201d\u9009\u9879\u6765\u6d4f\u89c8\u5e76\u9009\u62e9\u4f60\u7684Python\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>3. \u8fd0\u884cPython\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5927\u591a\u6570IDE\u90fd\u6709\u4e00\u4e2a\u8fd0\u884c\u6309\u94ae\uff0c\u901a\u5e38\u770b\u8d77\u6765\u50cf\u4e00\u4e2a\u7eff\u8272\u7684\u64ad\u653e\u6309\u94ae\u3002\u70b9\u51fb\u8fd9\u4e2a\u6309\u94ae\u53ef\u4ee5\u8fd0\u884c\u5f53\u524d\u6253\u5f00\u7684Python\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5728PyCharm\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728\u7f16\u8f91\u5668\u9876\u90e8\u7684\u5de5\u5177\u680f\u4e2d\u627e\u5230\u8fd9\u4e2a\u6309\u94ae\u3002<\/p>\n<\/p>\n<p><h4>4. \u914d\u7f6e\u8fd0\u884c\u53c2\u6570<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u914d\u7f6e\u8fd0\u884c\u53c2\u6570\uff0c\u6bd4\u5982\u547d\u4ee4\u884c\u53c2\u6570\u6216\u73af\u5883\u53d8\u91cf\u3002\u5728PyCharm\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201cRun\u201d\u83dc\u5355\u4e2d\u7684\u201cEdit Configurations\u201d\u9009\u9879\u6765\u914d\u7f6e\u8fd9\u4e9b\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><h4>5. \u4f7f\u7528\u8c03\u8bd5\u529f\u80fd<\/h4>\n<\/p>\n<p><p>IDE\u7684\u4e00\u4e2a\u91cd\u8981\u7279\u70b9\u662f\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u6267\u884c\u4ee3\u7801\u3001\u68c0\u67e5\u53d8\u91cf\u7684\u503c\u7b49\u3002\u8fd9\u4e9b\u529f\u80fd\u6709\u52a9\u4e8e\u4f60\u5feb\u901f\u53d1\u73b0\u548c\u4fee\u590d\u4ee3\u7801\u4e2d\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Python\u4ea4\u4e92\u5f0f\u73af\u5883<\/h3>\n<\/p>\n<p><h4>1. \u6253\u5f00Python\u4ea4\u4e92\u5f0f\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u6765\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u73af\u5883\u3002\u8fd9\u5c06\u542f\u52a8\u4e00\u4e2aPython\u89e3\u91ca\u5668\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4e2d\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>2. \u5bfc\u5165\u5e76\u8fd0\u884c\u811a\u672c<\/h4>\n<\/p>\n<p><p>\u5728\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>exec<\/code>\u51fd\u6570\u6765\u8fd0\u884cPython\u6587\u4ef6\u3002\u5047\u8bbe\u4f60\u7684Python\u6587\u4ef6\u540d\u4e3a<code>your_script.py<\/code>\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&quot;your_script.py&quot;) as f:<\/p>\n<p>    code = f.read()<\/p>\n<p>    exec(code)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u624b\u52a8\u8f93\u5165\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u4f60\u8fd8\u53ef\u4ee5\u5728\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\u624b\u52a8\u8f93\u5165\u548c\u8fd0\u884c\u4ee3\u7801\u3002\u8fd9\u5bf9\u4e8e\u6d4b\u8bd5\u548c\u8c03\u8bd5\u4ee3\u7801\u7247\u6bb5\u975e\u5e38\u6709\u7528\u3002\u4f60\u53ef\u4ee5\u9010\u884c\u8f93\u5165\u4ee3\u7801\u5e76\u7acb\u5373\u770b\u5230\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h4>4. \u4f7f\u7528IPython\u6216Jupyter Notebook<\/h4>\n<\/p>\n<p><p>IPython\u548cJupyter Notebook\u662fPython\u4ea4\u4e92\u5f0f\u73af\u5883\u7684\u9ad8\u7ea7\u7248\u672c\uff0c\u63d0\u4f9b\u4e86\u66f4\u591a\u529f\u80fd\u548c\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u5b89\u88c5\u8fd9\u4e9b\u5de5\u5177\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install ipython jupyter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165<code>ipython<\/code>\u6216<code>jupyter notebook<\/code>\u542f\u52a8\u8fd9\u4e9b\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><h4>1. \u8bbe\u7f6ePython\u73af\u5883\u53d8\u91cf<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u5728\u547d\u4ee4\u884c\u4e2d\u65b9\u4fbf\u5730\u8fd0\u884cPython\u6587\u4ef6\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u8bbe\u7f6ePython\u7684\u73af\u5883\u53d8\u91cf\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u4e2d\u7684\u201c\u73af\u5883\u53d8\u91cf\u201d\u9009\u9879\u6765\u8bbe\u7f6e\u3002\u5728Mac\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u7f16\u8f91<code>~\/.bashrc<\/code>\u6216<code>~\/.zshrc<\/code>\u6587\u4ef6\u6765\u6dfb\u52a0Python\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><h4>2. \u786e\u4fdd\u6587\u4ef6\u8def\u5f84\u6b63\u786e<\/h4>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u6587\u4ef6\u65f6\uff0c\u786e\u4fdd\u6587\u4ef6\u8def\u5f84\u6b63\u786e\u975e\u5e38\u91cd\u8981\u3002\u5982\u679c\u6587\u4ef6\u8def\u5f84\u4e2d\u5305\u542b\u7a7a\u683c\u6216\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5f15\u53f7\u6765\u62ec\u8d77\u8def\u5f84\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python &quot;C:\\Users\\YourUsername\\Documents\\Python Scripts\\your_script.py&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u4f7f\u7528\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u5728\u5f00\u53d1Python\u9879\u76ee\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u9879\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>virtualenv<\/code>\u6216<code>venv<\/code>\u6a21\u5757\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Mac\u548cLinux\u7cfb\u7edf\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<p><h4>4. \u8c03\u8bd5\u9519\u8bef<\/h4>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u6587\u4ef6\u65f6\uff0c\u5982\u679c\u9047\u5230\u9519\u8bef\uff0c\u53ef\u4ee5\u901a\u8fc7\u9605\u8bfb\u9519\u8bef\u6d88\u606f\u6765\u8c03\u8bd5\u95ee\u9898\u3002\u9519\u8bef\u6d88\u606f\u901a\u5e38\u4f1a\u6307\u793a\u51fa\u9519\u7684\u884c\u53f7\u548c\u9519\u8bef\u7c7b\u578b\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\u56de\u5230\u4ee3\u7801\u4e2d\u4fee\u6b63\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\u7684\u8def\u5f84\u6709\u591a\u79cd\u65b9\u6cd5\uff0c<strong>\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528IDE\u3001\u4f7f\u7528Python\u4ea4\u4e92\u5f0f\u73af\u5883<\/strong>\u662f\u5176\u4e2d\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u3002<strong>\u4f7f\u7528\u547d\u4ee4\u884c<\/strong>\u4e0d\u4ec5\u7b80\u5355\u76f4\u63a5\uff0c\u8fd8\u53ef\u4ee5\u65b9\u4fbf\u5730\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\uff1b<strong>\u4f7f\u7528IDE<\/strong>\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u548c\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\uff0c\u7279\u522b\u9002\u5408\u5927\u578b\u9879\u76ee\u5f00\u53d1\uff1b<strong>\u4f7f\u7528Python\u4ea4\u4e92\u5f0f\u73af\u5883<\/strong>\u5219\u975e\u5e38\u9002\u5408\u6d4b\u8bd5\u548c\u8c03\u8bd5\u4ee3\u7801\u7247\u6bb5\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u9700\u8981\u6ce8\u610f\u6587\u4ef6\u8def\u5f84\u7684\u6b63\u786e\u6027\u548cPython\u73af\u5883\u7684\u914d\u7f6e\u3002\u901a\u8fc7\u719f\u7ec3\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u5f00\u53d1\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u672c\u5730\u73af\u5883\u4e2d\u627e\u5230Python\u6587\u4ef6\u7684\u8def\u5f84\uff1f<\/strong><br \/>\u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\u65f6\uff0c\u786e\u5b9a\u6587\u4ef6\u7684\u8def\u5f84\u975e\u5e38\u91cd\u8981\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u6587\u4ef6\u7ba1\u7406\u5668\u4e2d\u627e\u5230\u8be5\u6587\u4ef6\uff0c\u53f3\u952e\u5355\u51fb\u6587\u4ef6\u5e76\u9009\u62e9\u201c\u5c5e\u6027\u201d\u6216\u201c\u4fe1\u606f\u201d\u6765\u67e5\u770b\u5b8c\u6574\u8def\u5f84\u3002\u53e6\u5916\uff0c\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\uff0c\u4f7f\u7528<code>pwd<\/code>\u547d\u4ee4\uff08\u5728Unix\u7cfb\u7edf\u4e0a\uff09\u6216<code>cd<\/code>\u547d\u4ee4\uff08\u5728Windows\u4e0a\uff09\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u4f60\u786e\u8ba4\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\uff0c\u4ece\u800c\u627e\u5230\u6587\u4ef6\u7684\u76f8\u5bf9\u8def\u5f84\u3002<\/p>\n<p><strong>\u6211\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u5de5\u5177\u6765\u66f4\u65b9\u4fbf\u5730\u8fd0\u884cPython\u6587\u4ef6\uff1f<\/strong><br \/>\u6709\u591a\u79cd\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u8f7b\u677e\u5730\u8fd0\u884cPython\u6587\u4ef6\uff0c\u5305\u62ec\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001Visual Studio Code\u548cJupyter Notebook\u3002\u8fd9\u4e9b\u5de5\u5177\u901a\u5e38\u63d0\u4f9b\u6587\u4ef6\u6d4f\u89c8\u529f\u80fd\uff0c\u4f7f\u4f60\u80fd\u591f\u65b9\u4fbf\u5730\u627e\u5230\u5e76\u8fd0\u884cPython\u6587\u4ef6\u3002\u6b64\u5916\uff0c\u547d\u4ee4\u884c\u754c\u9762\u4e5f\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u9009\u62e9\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5c0f\u578b\u811a\u672c\u548c\u81ea\u52a8\u5316\u4efb\u52a1\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u7684Python\u6587\u4ef6\u6709\u4f9d\u8d56\u5e93\uff0c\u6211\u8be5\u5982\u4f55\u5904\u7406\uff1f<\/strong><br \/>\u5728\u8fd0\u884c\u6709\u4f9d\u8d56\u5e93\u7684Python\u6587\u4ef6\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86\u6240\u6709\u5fc5\u8981\u7684\u5e93\u3002\u4f60\u53ef\u4ee5\u5728\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u4e00\u4e2a<code>requirements.txt<\/code>\u6587\u4ef6\uff0c\u5217\u51fa\u6240\u6709\u4f9d\u8d56\u9879\uff0c\u7136\u540e\u4f7f\u7528<code>pip install -r requirements.txt<\/code>\u547d\u4ee4\u6765\u6279\u91cf\u5b89\u88c5\u8fd9\u4e9b\u5e93\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u865a\u62df\u73af\u5883\uff0c\u786e\u4fdd\u5148\u6fc0\u6d3b\u5b83\uff0c\u8fd9\u6837\u4f9d\u8d56\u5e93\u5c31\u4f1a\u88ab\u5b89\u88c5\u5230\u6b63\u786e\u7684\u4f4d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u672c\u5730\u8fd0\u884cPython\u6587\u4ef6\u7684\u8def\u5f84\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u4f7f\u7528IDE\u3001\u4f7f\u7528Python\u4ea4\u4e92\u5f0f\u73af\u5883\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4 [&hellip;]","protected":false},"author":3,"featured_media":1162051,"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\/1162043"}],"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=1162043"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1162043\/revisions"}],"predecessor-version":[{"id":1162052,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1162043\/revisions\/1162052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1162051"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1162043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1162043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1162043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}