{"id":1017244,"date":"2024-12-27T12:24:35","date_gmt":"2024-12-27T04:24:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1017244.html"},"modified":"2024-12-27T12:24:40","modified_gmt":"2024-12-27T04:24:40","slug":"python2-7%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1017244.html","title":{"rendered":"python2.7\u5982\u4f55\u6253\u5f00"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25160200\/03ca4660-bfef-4330-b49a-b0792480a0d3.webp\" alt=\"python2.7\u5982\u4f55\u6253\u5f00\" \/><\/p>\n<p><p> <strong>\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u6253\u5f00Python 2.7\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5\u6b63\u786e\u7684Python\u73af\u5883\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3001\u8bbe\u7f6e\u597d\u73af\u5883\u53d8\u91cf\u3002<\/strong> \u5176\u4e2d\uff0c<strong>\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef<\/strong>\u662f\u6700\u5e38\u7528\u548c\u76f4\u63a5\u7684\u65b9\u5f0f\uff0c\u901a\u8fc7\u8f93\u5165\u547d\u4ee4<code>python2.7<\/code>\u6216<code>python<\/code>\u5373\u53ef\u542f\u52a8Python 2.7\u7684\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u5728\u8be6\u7ec6\u64cd\u4f5c\u4e2d\uff0c\u786e\u4fddPython 2.7\u7684\u5b89\u88c5\u8def\u5f84\u5df2\u6b63\u786e\u914d\u7f6e\u5728\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u5728\u4efb\u4f55\u4f4d\u7f6e\u901a\u8fc7\u547d\u4ee4\u884c\u8c03\u7528Python 2.7\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u68c0\u67e5\u5e76\u5b89\u88c5Python 2.7<\/h3>\n<\/p>\n<p><p>\u5728\u6253\u5f00Python 2.7\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u8ba4Python 2.7\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cPython 2.7\u5df2\u7ecf\u4e0d\u518d\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u7248\u672c\uff0c\u56e0\u4e3aPython 3.x\u7cfb\u5217\u5df2\u7ecf\u6210\u4e3a\u6807\u51c6\u3002\u4f46\u5982\u679c\u4f60\u9700\u8981\u4f7f\u7528Python 2.7\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dPython 2.7<\/strong>\uff1a\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E5%9C%A8%E2%80%9CDownloads%E2%80%9D%E9%A1%B5%E9%9D%A2%E4%B8%AD%E6%89%BE%E5%88%B0%E9%80%82%E7%94%A8%E4%BA%8E%E4%BD%A0%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84Python\">https:\/\/www.python.org\/\uff09\uff0c\u5728\u201cDownloads\u201d\u9875\u9762\u4e2d\u627e\u5230\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684Python<\/a> 2.7\u7248\u672c\u5e76\u4e0b\u8f7d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python 2.7<\/strong>\uff1a\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong>\uff1a\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u884c\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08Mac\/Linux\uff09\uff0c\u8f93\u5165<code>python2.7 --version<\/code>\u6216<code>python --version<\/code>\uff0c\u5982\u679c\u8fd4\u56de\u7684\u7248\u672c\u53f7\u4e3a2.7.x\uff0c\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u53ef\u4ee5\u4f7f\u5f97Python\u547d\u4ee4\u5728\u547d\u4ee4\u884c\u4e2d\u88ab\u8bc6\u522b\uff0c\u800c\u4e0d\u9700\u8981\u8f93\u5165\u5b8c\u6574\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f16\u8f91\u7cfb\u7edf\u53d8\u91cf<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u540d\u4e3a<code>Path<\/code>\u7684\u53d8\u91cf\uff0c\u9009\u4e2d\u5e76\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u5728\u53d8\u91cf\u503c\u7684\u672b\u5c3e\u6dfb\u52a0Python 2.7\u7684\u5b89\u88c5\u8def\u5f84\uff08\u4f8b\u5982\uff1a<code>C:\\Python27<\/code>\uff09\uff0c\u786e\u4fdd\u5404\u8def\u5f84\u4e4b\u95f4\u7528\u5206\u53f7\u9694\u5f00\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u786e\u8ba4\u5e76\u4fdd\u5b58<\/strong>\uff1a\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u4fdd\u5b58\u6240\u6709\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u6253\u5f00Python 2.7<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u6309\u4e0b<code>Win + R<\/code>\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u6253\u5f00\u201cTerminal\u201d\u5e94\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8f93\u5165\u542f\u52a8\u547d\u4ee4<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u8f93\u5165<code>python2.7<\/code>\u6216\u4ec5\u8f93\u5165<code>python<\/code>\uff0c\u7136\u540e\u6309\u56de\u8f66\u3002<\/li>\n<li>\u5982\u679c\u5b89\u88c5\u548c\u914d\u7f6e\u6b63\u786e\uff0c\u4f60\u5c06\u770b\u5230Python 2.7\u7684\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u542f\u52a8\uff0c\u5c4f\u5e55\u4e0a\u4f1a\u663e\u793a\u7248\u672c\u4fe1\u606f\u548c\u63d0\u793a\u7b26\uff08&gt;&gt;&gt;\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9000\u51faPython\u89e3\u91ca\u5668<\/strong>\uff1a\u4f7f\u7528<code>exit()<\/code>\u6216\u6309\u4e0b<code>Ctrl + Z<\/code>\uff08Windows\uff09\u6216<code>Ctrl + D<\/code>\uff08Mac\/Linux\uff09\u6765\u9000\u51faPython\u4ea4\u4e92\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528Python\u811a\u672c\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u76f4\u63a5\u5728\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u4e2d\u8f93\u5165\u547d\u4ee4\uff0c\u4f60\u8fd8\u53ef\u4ee5\u7f16\u5199Python\u811a\u672c\u6587\u4ef6\u5e76\u8fd0\u884c\u5b83\u4eec\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c\u6587\u4ef6<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad++\u3001Sublime Text\u3001Atom\u7b49\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u672c\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6269\u5c55\u540d\uff08\u4f8b\u5982\uff1a<code>hello.py<\/code>\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199Python\u4ee3\u7801<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u6587\u672c\u6587\u4ef6\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">print(&quot;Hello, Python 2.7!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d\u5bfc\u822a\u5230Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u53ef\u4ee5\u6539\u53d8\u5f53\u524d\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165<code>python hello.py<\/code>\uff0c\u7136\u540e\u6309\u56de\u8f66\u8fd0\u884c\u811a\u672c\u3002<\/li>\n<li>\u4f60\u5c06\u5728\u5c4f\u5e55\u4e0a\u770b\u5230\u811a\u672c\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u7ba1\u7406Python 2.7\u7684\u5e93\u548c\u4f9d\u8d56<\/h3>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Python 2.7\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u5b89\u88c5\u548c\u7ba1\u7406\u989d\u5916\u7684\u5e93\u548c\u4f9d\u8d56\u3002\u901a\u5e38\u4f7f\u7528<code>pip<\/code>\u5de5\u5177\u6765\u5b8c\u6210\u8fd9\u4e00\u4efb\u52a1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5pip<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u6ca1\u6709\u5b89\u88c5pip\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u7f51\u6216\u4f7f\u7528get-pip.py\u811a\u672c\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u5e93<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u547d\u4ee4<code>pip install library_name<\/code>\u6765\u5b89\u88c5\u9700\u8981\u7684\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ba1\u7406\u5df2\u5b89\u88c5\u7684\u5e93<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>pip list<\/code>\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u5e93\u3002<\/li>\n<li>\u4f7f\u7528<code>pip uninstall library_name<\/code>\u5378\u8f7d\u4e0d\u9700\u8981\u7684\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>Python 2.7\u7684\u652f\u6301\u7ed3\u675f<\/strong>\uff1aPython 2.7\u7684\u5b98\u65b9\u652f\u6301\u5df2\u4e8e2020\u5e741\u67081\u65e5\u7ed3\u675f\uff0c\u56e0\u6b64\u5efa\u8bae\u5c3d\u91cf\u5347\u7ea7\u5230Python 3.x\u7248\u672c\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u517c\u5bb9\u6027\u95ee\u9898<\/strong>\uff1a\u5728\u5f00\u53d1\u65b0\u9879\u76ee\u65f6\uff0c\u5c3d\u91cf\u907f\u514d\u4f7f\u7528Python 2.7\uff0c\u56e0\u4e3a\u5176\u4e0ePython 3.x\u7248\u672c\u4e0d\u5b8c\u5168\u517c\u5bb9\uff0c\u53ef\u80fd\u5bfc\u81f4\u4ee3\u7801\u5728\u4e0d\u540c\u7248\u672c\u95f4\u8fd0\u884c\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ef4\u62a4\u65e7\u9879\u76ee<\/strong>\uff1a\u5982\u679c\u9700\u8981\u7ef4\u62a4\u4f7f\u7528Python 2.7\u5f00\u53d1\u7684\u65e7\u9879\u76ee\uff0c\u5efa\u8bae\u9010\u6b65\u5c06\u5176\u8fc1\u79fb\u5230Python 3.x\u7248\u672c\uff0c\u4ee5\u964d\u4f4e\u957f\u671f\u7ef4\u62a4\u7684\u96be\u5ea6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e03\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u6b63\u786e\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u8ba1\u7b97\u673a\u4e0a\u6253\u5f00Python 2.7\uff0c\u5e76\u4f7f\u7528\u5176\u8fdb\u884c\u5f00\u53d1\u548c\u8c03\u8bd5\u3002\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u6ce8\u610f\u7ba1\u7406\u597d\u73af\u5883\u53d8\u91cf\u548c\u4f9d\u8d56\u5e93\uff0c\u540c\u65f6\u5173\u6ce8Python\u7248\u672c\u7684\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u4ee5\u786e\u4fdd\u9879\u76ee\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u5c3d\u7ba1Python 2.7\u5df2\u505c\u6b62\u5b98\u65b9\u652f\u6301\uff0c\u4f46\u5728\u67d0\u4e9b\u7279\u5b9a\u573a\u666f\u4e0b\uff0c\u5b83\u4ecd\u7136\u5177\u6709\u4e00\u5b9a\u7684\u4f7f\u7528\u4ef7\u503c\u3002\u901a\u8fc7\u672c\u6587\u7684\u6307\u5bfc\uff0c\u5e0c\u671b\u4f60\u80fd\u66f4\u52a0\u9ad8\u6548\u5730\u4f7f\u7528Python 2.7\u8fdb\u884c\u76f8\u5173\u7684\u5f00\u53d1\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u7cfb\u7edf\u4e0a\u6253\u5f00Python 2.7\uff1f<\/strong><br \/>\u8981\u5728Windows\u4e0a\u6253\u5f00Python 2.7\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Python 2.7\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u6765\u68c0\u67e5\u662f\u5426\u6210\u529f\u5b89\u88c5\u3002\u5982\u679c\u770b\u5230Python\u7684\u7248\u672c\u4fe1\u606f\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u82e5\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u5408\u7684\u7248\u672c\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u542f\u52a8\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u6216\u8005\u901a\u8fc7\u53cc\u51fbPython\u811a\u672c\u6587\u4ef6\u6765\u8fd0\u884c\u3002<\/p>\n<p><strong>\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\u5982\u4f55\u6253\u5f00Python 2.7\uff1f<\/strong><br \/>\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u53ef\u4ee5\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python<\/code>\u6765\u6253\u5f00Python 2.7\u3002\u5982\u679c\u7cfb\u7edf\u4e2d\u5b89\u88c5\u6709\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python2<\/code>\u547d\u4ee4\u6765\u660e\u786e\u8c03\u7528Python 2.7\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\uff08\u5982Homebrew\u6216apt\uff09\u8fdb\u884c\u5b89\u88c5\uff0c\u5b89\u88c5\u540e\u540c\u6837\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u542f\u52a8\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python 2.7\u4e2d\u6267\u884c\u811a\u672c\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5728Python 2.7\u4e2d\u6267\u884c\u811a\u672c\u6587\u4ef6\uff0c\u9996\u5148\u9700\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\u3002\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u8fdb\u5165\u76ee\u5f55\u540e\uff0c\u8f93\u5165<code>python script_name.py<\/code>\uff08\u5c06<code>script_name.py<\/code>\u66ff\u6362\u4e3a\u4f60\u7684\u811a\u672c\u6587\u4ef6\u540d\uff09\u5373\u53ef\u6267\u884c\u8be5\u811a\u672c\u3002\u5982\u679c\u7cfb\u7edf\u4e2d\u6709\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u7528<code>python2 script_name.py<\/code>\u6765\u786e\u4fdd\u4f7f\u7528\u7684\u662fPython 2.7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u6253\u5f00Python 2.7\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5\u6b63\u786e\u7684Python\u73af\u5883\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3001\u8bbe\u7f6e\u597d\u73af\u5883\u53d8\u91cf\u3002 [&hellip;]","protected":false},"author":3,"featured_media":1017255,"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\/1017244"}],"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=1017244"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1017244\/revisions"}],"predecessor-version":[{"id":1017256,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1017244\/revisions\/1017256"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1017255"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1017244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1017244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1017244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}