{"id":976938,"date":"2024-12-27T06:25:32","date_gmt":"2024-12-26T22:25:32","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/976938.html"},"modified":"2024-12-27T06:25:35","modified_gmt":"2024-12-26T22:25:35","slug":"%e5%a6%82%e4%bd%95%e6%8c%87%e5%ae%9apython%e8%a7%a3%e9%87%8a%e5%99%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/976938.html","title":{"rendered":"\u5982\u4f55\u6307\u5b9apython\u89e3\u91ca\u5668"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24202424\/ae8258e8-cae0-4ab8-9669-55ad3a1c8098.webp\" alt=\"\u5982\u4f55\u6307\u5b9apython\u89e3\u91ca\u5668\" \/><\/p>\n<p><p> <strong>\u6307\u5b9aPython\u89e3\u91ca\u5668\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u3001\u5728\u811a\u672c\u4e2d\u4f7f\u7528shebang\u6307\u5b9a\u3001\u901a\u8fc7\u865a\u62df\u73af\u5883\u6307\u5b9a\u3001\u5728IDE\u4e2d\u914d\u7f6e\u3002<\/strong>\u5176\u4e2d\uff0c<strong>\u901a\u8fc7\u865a\u62df\u73af\u5883\u6307\u5b9a<\/strong>\u662f\u6700\u4e3a\u63a8\u8350\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u80fd\u6709\u6548\u907f\u514d\u5305\u7248\u672c\u51b2\u7a81\u5e76\u4fdd\u6301\u9879\u76ee\u7684\u72ec\u7acb\u6027\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u865a\u62df\u73af\u5883\u6307\u5b9aPython\u89e3\u91ca\u5668\u7684\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\uff0c\u901a\u8fc7\u8fd0\u884c\u547d\u4ee4<code>python -m venv myenv<\/code>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff0c\u5176\u4e2d<code>myenv<\/code>\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u72ec\u7acbPython\u89e3\u91ca\u5668\u548c\u5305\u7684\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884c<code>myenv\\Scripts\\activate<\/code>\uff0c\u5728Unix\u6216MacOS\u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884c<code>source myenv\/bin\/activate<\/code>\uff0c\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u3002\u6fc0\u6d3b\u540e\uff0c\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u5c06\u4f1a\u6539\u53d8\uff0c\u663e\u793a\u5f53\u524d\u6d3b\u8dc3\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\u5305<\/strong>\uff1a\u4f7f\u7528<code>pip install package_name<\/code>\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u5305\uff0c\u8fd9\u4e9b\u5305\u5c06\u88ab\u5b89\u88c5\u5230\u865a\u62df\u73af\u5883\u4e2d\uff0c\u800c\u4e0d\u662f\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6307\u5b9a\u89e3\u91ca\u5668\u8def\u5f84<\/strong>\uff1a\u5728IDE\u6216\u7f16\u8f91\u5668\u4e2d\uff08\u5982PyCharm\u3001VSCode\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u9879\u76ee\u7684\u89e3\u91ca\u5668\u8def\u5f84\u4e3a\u865a\u62df\u73af\u5883\u4e2d\u7684Python\u89e3\u91ca\u5668\u8def\u5f84\uff0c\u901a\u5e38\u662f<code>myenv\/bin\/python<\/code>\u6216<code>myenv\/Scripts\/python.exe<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u4fdd\u6301\u73af\u5883\u7684\u6e05\u6d01\u548c\u53ef\u63a7\uff0c\u907f\u514d\u5305\u7248\u672c\u51b2\u7a81\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6765\u6307\u5b9aPython\u89e3\u91ca\u5668\u662f\u4e00\u79cd\u4e34\u65f6\u7684\u3001\u5feb\u901f\u7684\u65b9\u6cd5\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u89e3\u91ca\u5668\u7684\u8def\u5f84\u6765\u8fd0\u884cPython\u811a\u672c\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">\/path\/to\/python my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u547d\u4ee4\u4e2d\uff0c<code>\/path\/to\/python<\/code>\u662f\u4f60\u60f3\u8981\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\u7684\u8def\u5f84\uff0c\u800c<code>my_script.py<\/code>\u662f\u4f60\u7684Python\u811a\u672c\u6587\u4ef6\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u5e0c\u671b\u5728\u4e0d\u540c\u7684\u89e3\u91ca\u5668\u4e4b\u95f4\u5feb\u901f\u5207\u6362\u800c\u4e0d\u60f3\u66f4\u6539\u7cfb\u7edf\u8bbe\u7f6e\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4ec5\u5bf9\u5355\u6b21\u8fd0\u884c\u6709\u6548\uff0c\u5982\u679c\u4f60\u9700\u8981\u5728\u591a\u6b21\u8fd0\u884c\u4e2d\u4fdd\u6301\u4e00\u81f4\u7684\u89e3\u91ca\u5668\u8bbe\u7f6e\uff0c\u5efa\u8bae\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\uff0c\u5982\u865a\u62df\u73af\u5883\u6216shebang\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5728\u811a\u672c\u4e2d\u4f7f\u7528shebang\u6307\u5b9a<\/p>\n<\/p>\n<p><p>\u5728Unix\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728Python\u811a\u672c\u7684\u7b2c\u4e00\u884c\u4f7f\u7528shebang\u6765\u6307\u5b9a\u89e3\u91ca\u5668\u3002shebang\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6ce8\u91ca\uff0c\u6307\u793a\u7cfb\u7edf\u4f7f\u7528\u54ea\u4e2a\u89e3\u91ca\u5668\u6765\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<\/p>\n<p><p>\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">#!\/usr\/bin\/env python3<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>#!\/usr\/bin\/env python3<\/code>\u544a\u8bc9\u7cfb\u7edf\u4f7f\u7528\u73af\u5883\u4e2d\u53ef\u7528\u7684Python 3\u89e3\u91ca\u5668\u6765\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\u3002\u4f7f\u7528<code>\/usr\/bin\/env<\/code>\u7684\u597d\u5904\u662f\u5b83\u4f1a\u81ea\u52a8\u67e5\u627ePython\u89e3\u91ca\u5668\u7684\u8def\u5f84\uff0c\u800c\u4e0d\u9700\u8981\u786c\u7f16\u7801\u7279\u5b9a\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>shebang\u65b9\u6cd5\u5c24\u5176\u9002\u5408\u7528\u4e8eLinux\u548cUnix\u73af\u5883\u4e2d\u7684\u811a\u672c\u6587\u4ef6\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u8ba9\u811a\u672c\u6587\u4ef6\u5728\u4e0d\u540c\u7684\u7cfb\u7edf\u4e2d\u5177\u6709\u66f4\u597d\u7684\u53ef\u79fb\u690d\u6027\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u901a\u8fc7\u865a\u62df\u73af\u5883\u6307\u5b9a<\/p>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u662fPython\u5f00\u53d1\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u907f\u514d\u5305\u7248\u672c\u51b2\u7a81\uff0c\u5e76\u786e\u4fdd\u9879\u76ee\u7684\u53ef\u79fb\u690d\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u865a\u62df\u73af\u5883\u5de5\u5177<\/strong>\uff1a\u5728Python 3\u4e2d\uff0c\u865a\u62df\u73af\u5883\u5de5\u5177venv\u5df2\u7ecf\u5305\u542b\u5728\u6807\u51c6\u5e93\u4e2d\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002\u5982\u679c\u4f60\u4f7f\u7528Python 2\uff0c\u53ef\u4ee5\u4f7f\u7528virtualenv\u5de5\u5177\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u542b\u72ec\u7acb\u7684Python\u89e3\u91ca\u5668\u548c\u76f8\u5173\u7684\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728Windows\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4<code>myenv\\Scripts\\activate<\/code>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1b\u5728Unix\u6216MacOS\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4<code>source myenv\/bin\/activate<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5de5\u4f5c<\/strong>\uff1a\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u6240\u6709\u7684Python\u547d\u4ee4\u548c\u5305\u5b89\u88c5\u547d\u4ee4\uff08\u5982<code>pip install<\/code>\uff09\u90fd\u5c06\u5728\u865a\u62df\u73af\u5883\u4e2d\u6267\u884c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9000\u51fa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5728\u5b8c\u6210\u5de5\u4f5c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>deactivate<\/code>\u547d\u4ee4\u9000\u51fa\u865a\u62df\u73af\u5883\uff0c\u6062\u590d\u5230\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5728IDE\u4e2d\u914d\u7f6e<\/p>\n<\/p>\n<p><p>\u5927\u591a\u6570\u73b0\u4ee3IDE\uff08\u5982PyCharm\u3001Visual Studio Code\u3001Eclipse\u7b49\uff09\u90fd\u652f\u6301\u4e3a\u6bcf\u4e2a\u9879\u76ee\u6307\u5b9aPython\u89e3\u91ca\u5668\u3002\u8fd9\u53ef\u4ee5\u5728IDE\u7684\u9879\u76ee\u8bbe\u7f6e\u6216\u914d\u7f6e\u9875\u9762\u4e2d\u5b8c\u6210\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>PyCharm<\/strong>\uff1a\u5728PyCharm\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7<code>File &gt; Settings &gt; Project: &lt;project_name&gt; &gt; Python Interpreter<\/code>\u8def\u5f84\u6765\u9009\u62e9\u6216\u6dfb\u52a0\u65b0\u7684Python\u89e3\u91ca\u5668\u3002\u4f60\u53ef\u4ee5\u9009\u62e9\u7cfb\u7edf\u89e3\u91ca\u5668\u3001\u865a\u62df\u73af\u5883\u89e3\u91ca\u5668\uff0c\u751a\u81f3\u662fDocker\u6216\u8fdc\u7a0b\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Visual Studio Code<\/strong>\uff1a\u5728VSCode\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0b<code>Ctrl+Shift+P<\/code>\u6253\u5f00\u547d\u4ee4\u9762\u677f\uff0c\u8f93\u5165<code>Python: Select Interpreter<\/code>\uff0c\u7136\u540e\u9009\u62e9\u6216\u641c\u7d22\u4f60\u60f3\u8981\u7684Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Eclipse (PyDev)<\/strong>\uff1a\u5728Eclipse\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7<code>Window &gt; Preferences &gt; PyDev &gt; Interpreters &gt; Python Interpreter<\/code>\u8def\u5f84\u6765\u6dfb\u52a0\u6216\u9009\u62e9Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u5728IDE\u4e2d\u914d\u7f6ePython\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u786e\u4fdd\u5728\u5f00\u53d1\u65f6\u4f7f\u7528\u6b63\u786e\u7684\u89e3\u91ca\u5668\uff0c\u5e76\u4e14IDE\u901a\u5e38\u4f1a\u81ea\u52a8\u5904\u7406\u5305\u7d22\u5f15\u548c\u865a\u62df\u73af\u5883\u7684\u6fc0\u6d3b\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u5728\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u8bbe\u7f6e<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5728\u7cfb\u7edf\u8303\u56f4\u5185\u66f4\u6539\u9ed8\u8ba4\u7684Python\u89e3\u91ca\u5668\u3002\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows<\/strong>\uff1a\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7<code>\u63a7\u5236\u9762\u677f &gt; \u7cfb\u7edf\u548c\u5b89\u5168 &gt; \u7cfb\u7edf &gt; \u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e &gt; \u73af\u5883\u53d8\u91cf<\/code>\u8def\u5f84\u6765\u4fee\u6539<code>PATH<\/code>\u53d8\u91cf\u3002\u5c06\u4f60\u5e0c\u671b\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\u7684\u8def\u5f84\u6dfb\u52a0\u5230<code>PATH<\/code>\u53d8\u91cf\u7684\u5f00\u5934\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Linux\/Unix\/MacOS<\/strong>\uff1a\u5728\u8fd9\u4e9b\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982<code>~\/.bashrc<\/code>\u6216<code>~\/.zshrc<\/code>\uff09\u6765\u4fee\u6539<code>PATH<\/code>\u53d8\u91cf\u3002\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/path\/to\/python:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u8fd0\u884c<code>source ~\/.bashrc<\/code>\u6216<code>source ~\/.zshrc<\/code>\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fee\u6539\u7cfb\u7edf\u7684<code>PATH<\/code>\u53d8\u91cf\u4f1a\u5f71\u54cd\u6240\u6709\u4f7f\u7528Python\u7684\u7a0b\u5e8f\uff0c\u56e0\u6b64\u5efa\u8bae\u8c28\u614e\u64cd\u4f5c\uff0c\u5e76\u4f18\u5148\u8003\u8651\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u6307\u5b9aPython\u89e3\u91ca\u5668\uff1f<\/strong><br \/>\u5728Windows\u3001macOS\u548cLinux\u7b49\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u6307\u5b9aPython\u89e3\u91ca\u5668\u7684\u65b9\u6cd5\u7565\u6709\u4e0d\u540c\u3002\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u53d8\u91cfPATH\u6765\u8bbe\u7f6e\u9ed8\u8ba4\u7684Python\u7248\u672c\uff1b\u5728macOS\u548cLinux\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u547d\u4ee4\u884c\u5de5\u5177\u5982<code>update-alternatives<\/code>\u6216\u4f7f\u7528<code>virtualenv<\/code>\u6765\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684Python\u3002<\/p>\n<p><strong>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5982\u4f55\u9009\u62e9Python\u89e3\u91ca\u5668\uff1f<\/strong><br \/>\u521b\u5efa\u865a\u62df\u73af\u5883\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9aPython\u7248\u672c\u6765\u9009\u62e9\u89e3\u91ca\u5668\u3002\u4f7f\u7528<code>python -m venv myenv --python=python3.8<\/code>\u547d\u4ee4\uff0c\u53ef\u4ee5\u660e\u786e\u6307\u5b9a\u4f7f\u7528Python 3.8\u7248\u672c\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u8fd9\u6837\uff0c\u8fdb\u5165\u865a\u62df\u73af\u5883\u540e\uff0c\u6240\u6709\u8fd0\u884c\u7684Python\u4ee3\u7801\u90fd\u5c06\u4f7f\u7528\u6307\u5b9a\u7684\u89e3\u91ca\u5668\u3002<\/p>\n<p><strong>\u4e3a\u4ec0\u4e48\u9700\u8981\u6307\u5b9aPython\u89e3\u91ca\u5668\uff1f<\/strong><br \/>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u9879\u76ee\u53ef\u80fd\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7248\u672c\u7684Python\u6216\u7279\u5b9a\u7684\u5e93\u3002\u6307\u5b9aPython\u89e3\u91ca\u5668\u53ef\u4ee5\u786e\u4fdd\u4ee3\u7801\u5728\u9884\u671f\u7684\u73af\u5883\u4e2d\u8fd0\u884c\uff0c\u907f\u514d\u56e0\u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u95ee\u9898\u3002\u6b64\u5916\uff0c\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684Python\u73af\u5883\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u548c\u660e\u786e\u7684\u89e3\u91ca\u5668\u8def\u5f84\u53ef\u4ee5\u5e2e\u52a9\u66f4\u597d\u5730\u7ba1\u7406\u8fd9\u4e9b\u4f9d\u8d56\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6307\u5b9aPython\u89e3\u91ca\u5668\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6307\u5b9a\u3001\u5728\u811a\u672c\u4e2d\u4f7f\u7528shebang\u6307\u5b9a\u3001\u901a\u8fc7\u865a\u62df\u73af\u5883\u6307\u5b9a\u3001\u5728ID [&hellip;]","protected":false},"author":3,"featured_media":976944,"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\/976938"}],"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=976938"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/976938\/revisions"}],"predecessor-version":[{"id":976950,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/976938\/revisions\/976950"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/976944"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=976938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=976938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=976938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}