{"id":1024661,"date":"2024-12-30T14:15:39","date_gmt":"2024-12-30T06:15:39","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1024661.html"},"modified":"2024-12-30T14:15:41","modified_gmt":"2024-12-30T06:15:41","slug":"%e5%a6%82%e4%bd%95%e7%94%a8dos%e8%bf%9b%e5%85%a5python-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1024661.html","title":{"rendered":"\u5982\u4f55\u7528dos\u8fdb\u5165python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/48ebd727-b68d-4241-8775-92cb3566acb7.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u7528dos\u8fdb\u5165python\" \/><\/p>\n<p><p> <strong>\u8981\u7528DOS\u8fdb\u5165Python\uff0c\u6709\u51e0\u4e2a\u6b65\u9aa4\u9700\u8981\u9075\u5faa<\/strong>\uff1a<strong>\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\uff08CMD\uff09\u5e76\u8f93\u5165Python\u547d\u4ee4<\/strong>\u3002\u5176\u4e2d\uff0c\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u786e\u4fddPython\u547d\u4ee4\u5728\u4efb\u4f55\u76ee\u5f55\u90fd\u53ef\u4ee5\u88ab\u8bc6\u522b\u7684\u5173\u952e\u6b65\u9aa4\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u5b89\u88c5Python<\/h2>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u3002Python\u7684\u5b89\u88c5\u6587\u4ef6\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u4e0b\u8f7d\u3002\u9009\u62e9\u9002\u5408\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff08Windows\u3001macOS\u6216Linux\uff09\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h3>\u4e0b\u8f7d\u548c\u5b89\u88c5Python<\/h3>\n<\/p>\n<ol>\n<li>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u5408\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li>\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u9009\u62e9\u201c\u5b89\u88c5\u73b0\u5728\u201d\u6216\u201c\u81ea\u5b9a\u4e49\u5b89\u88c5\u201d\u3002<\/li>\n<li>\u786e\u4fdd\u52fe\u9009\u201c\u5c06Python\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u201d\u9009\u9879\uff0c\u8fd9\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\u3002<\/li>\n<li>\u5b8c\u6210\u5b89\u88c5\u540e\uff0cPython\u5c06\u88ab\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u8def\u5f84\u4e2d\uff0c\u8fd9\u5141\u8bb8\u4f60\u4ece\u547d\u4ee4\u63d0\u793a\u7b26\u76f4\u63a5\u8fd0\u884cPython\u3002<\/li>\n<\/ol>\n<p><h2>\u4e8c\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h2>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5Python\u65f6\u6ca1\u6709\u52fe\u9009\u201c\u5c06Python\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u201d\u9009\u9879\uff0c\u4f60\u9700\u8981\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u201cpython\u201d\u65f6\uff0c\u7cfb\u7edf\u80fd\u591f\u627e\u5230Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<p><h3>\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<ol>\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\u9009\u62e9\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u5e76\u9009\u62e9\u201cPath\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u5728\u53d8\u91cf\u503c\u4e2d\uff0c\u6dfb\u52a0Python\u7684\u5b89\u88c5\u8def\u5f84\uff08\u4f8b\u5982\uff1aC:\\Python39\\\uff09\u3002<\/li>\n<li>\u786e\u8ba4\u5e76\u4fdd\u5b58\u6240\u6709\u8bbe\u7f6e\u3002<\/li>\n<\/ol>\n<p><h2>\u4e09\u3001\u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\uff08CMD\uff09<\/h2>\n<\/p>\n<p><p>\u73b0\u5728\uff0c\u4f60\u9700\u8981\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08CMD\uff09\u6765\u542f\u52a8Python\u3002<\/p>\n<\/p>\n<p><h3>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26<\/h3>\n<\/p>\n<ol>\n<li>\u6309\u4e0bWindows\u952e+R\uff0c\u8f93\u5165\u201ccmd\u201d\uff0c\u7136\u540e\u6309\u56de\u8f66\u3002<\/li>\n<li>\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\uff0c\u641c\u7d22\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u6216\u201ccmd\u201d\uff0c\u7136\u540e\u70b9\u51fb\u6253\u5f00\u3002<\/li>\n<\/ol>\n<p><h2>\u56db\u3001\u8f93\u5165Python\u547d\u4ee4<\/h2>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u201cpython\u201d\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c\u4f60\u5c06\u770b\u5230Python\u89e3\u91ca\u5668\u542f\u52a8\uff0c\u5e76\u663e\u793aPython\u7248\u672c\u53f7\u548c\u63d0\u793a\u7b26\uff08&gt;&gt;&gt;\uff09\uff0c\u8868\u660e\u4f60\u5df2\u7ecf\u6210\u529f\u8fdb\u5165Python\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h3>\u9a8c\u8bc1Python\u5b89\u88c5<\/h3>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u8f93\u5165\u201cpython &#8211;version\u201d\u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u67e5\u770b\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/li>\n<li>\u8f93\u5165\u201cpython\u201d\u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u8fdb\u5165Python\u89e3\u91ca\u5668\u3002<\/li>\n<\/ol>\n<p><h2>\u4e94\u3001\u4f7f\u7528Python\u89e3\u91ca\u5668<\/h2>\n<\/p>\n<p><p>\u4e00\u65e6\u8fdb\u5165Python\u89e3\u91ca\u5668\uff0c\u4f60\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684Python\u547d\u4ee4\u548c\u64cd\u4f5c\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u8fd0\u884c\u7b80\u5355\u7684Python\u4ee3\u7801<\/h3>\n<\/p>\n<ol>\n<li>\u8f93\u5165 <code>print(&quot;Hello, World!&quot;)<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>Python\u89e3\u91ca\u5668\u5c06\u6267\u884c\u8fd9\u884c\u4ee3\u7801\uff0c\u5e76\u8f93\u51fa\u201cHello, World!\u201d\u3002<\/li>\n<\/ol>\n<p><h3>\u9000\u51faPython\u89e3\u91ca\u5668<\/h3>\n<\/p>\n<ol>\n<li>\u8f93\u5165 <code>exit()<\/code> \u6216\u6309\u4e0b <code>Ctrl+Z<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>\u4f60\u5c06\u8fd4\u56de\u5230\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<\/ol>\n<p><h2>\u516d\u3001\u521b\u5efa\u548c\u8fd0\u884cPython\u811a\u672c<\/h2>\n<\/p>\n<p><p>\u9664\u4e86\u5728Python\u89e3\u91ca\u5668\u4e2d\u76f4\u63a5\u8f93\u5165\u4ee3\u7801\uff0c\u4f60\u8fd8\u53ef\u4ee5\u521b\u5efaPython\u811a\u672c\u6587\u4ef6\uff08.py\uff09\uff0c\u7136\u540e\u901a\u8fc7\u547d\u4ee4\u63d0\u793a\u7b26\u8fd0\u884c\u8fd9\u4e9b\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h3>\u521b\u5efaPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad\u6216VS Code\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0bPython\u4ee3\u7801\u5e76\u4fdd\u5b58\u4e3aexample.py\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u8fd0\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u4fdd\u5b58\u811a\u672c\u7684\u76ee\u5f55\uff08\u4f7f\u7528\u201ccd\u201d\u547d\u4ee4\uff09\u3002<\/li>\n<li>\u8f93\u5165 <code>python example.py<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>Python\u5c06\u6267\u884c\u811a\u672c\u5e76\u8f93\u51fa\u201cHello, World!\u201d\u3002<\/li>\n<\/ol>\n<p><h2>\u4e03\u3001\u5e38\u89c1\u95ee\u9898\u548c\u6545\u969c\u6392\u9664<\/h2>\n<\/p>\n<p><p>\u5728\u4f7f\u7528DOS\u8fdb\u5165Python\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6545\u969c\u6392\u9664\u7684\u5efa\u8bae\u3002<\/p>\n<\/p>\n<p><h3>\u95ee\u9898\uff1aPython\u547d\u4ee4\u672a\u88ab\u8bc6\u522b<\/h3>\n<\/p>\n<p><p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fddPython\u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/li>\n<li>\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u662f\u5426\u6b63\u786e\u3002<\/li>\n<li>\u91cd\u542f\u547d\u4ee4\u63d0\u793a\u7b26\u5e76\u5c1d\u8bd5\u518d\u6b21\u8f93\u5165\u201cpython\u201d\u3002<\/li>\n<\/ol>\n<p><h3>\u95ee\u9898\uff1a\u65e0\u6cd5\u8fd0\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<p><p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u811a\u672c\u6587\u4ef6\u4fdd\u5b58\u4e3a\u201c.py\u201d\u6269\u5c55\u540d\u3002<\/li>\n<li>\u786e\u4fdd\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u68c0\u67e5\u811a\u672c\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u662f\u5426\u6b63\u786e\u3002<\/li>\n<\/ol>\n<p><h2>\u516b\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u53d1Python\u9879\u76ee\u65f6\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u4f60\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u51b2\u7a81\u3002<\/p>\n<\/p>\n<p><h3>\u521b\u5efa\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u4f60\u7684\u9879\u76ee\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165 <code>python -m venv venv<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cvenv\u201d\u7684\u865a\u62df\u73af\u5883\u76ee\u5f55\u3002<\/li>\n<\/ol>\n<p><h3>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<ol>\n<li>\u5728Windows\u4e0a\uff0c\u8f93\u5165 <code>venv\\Scripts\\activate<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\u3002<\/li>\n<li>\u5728\u865a\u62df\u73af\u5883\u6fc0\u6d3b\u540e\uff0c\u4f60\u5c06\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u524d\u770b\u5230\u201c(venv)\u201d\u524d\u7f00\u3002<\/li>\n<\/ol>\n<p><h3>\u5b89\u88c5\u4f9d\u8d56\u5305<\/h3>\n<\/p>\n<ol>\n<li>\u4f7f\u7528 <code>pip<\/code> \u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5305\uff0c\u4f8b\u5982 <code>pip install requests<\/code>\u3002<\/li>\n<li>\u6240\u6709\u4f9d\u8d56\u5305\u5c06\u88ab\u5b89\u88c5\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u4e0d\u4f1a\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002<\/li>\n<\/ol>\n<p><h3>\u9000\u51fa\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<ol>\n<li>\u8f93\u5165 <code>deactivate<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u8fd4\u56de\u5230\u5168\u5c40Python\u73af\u5883\u3002<\/li>\n<\/ol>\n<p><h2>\u4e5d\u3001\u4f7f\u7528Python\u5305\u7ba1\u7406\u5668\uff08pip\uff09<\/h2>\n<\/p>\n<p><p><code>pip<\/code> \u662fPython\u7684\u5305\u7ba1\u7406\u5668\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<p><h3>\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h3>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u8f93\u5165 <code>pip install package_name<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u5c06\u201cpackage_name\u201d\u66ff\u6362\u4e3a\u4f60\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7684\u540d\u79f0\u3002<\/li>\n<\/ol>\n<p><h3>\u5378\u8f7d\u8f6f\u4ef6\u5305<\/h3>\n<\/p>\n<ol>\n<li>\u8f93\u5165 <code>pip uninstall package_name<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u5c06\u201cpackage_name\u201d\u66ff\u6362\u4e3a\u4f60\u8981\u5378\u8f7d\u7684\u8f6f\u4ef6\u5305\u7684\u540d\u79f0\u3002<\/li>\n<\/ol>\n<p><h3>\u5217\u51fa\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305<\/h3>\n<\/p>\n<ol>\n<li>\u8f93\u5165 <code>pip list<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u5217\u8868\u3002<\/li>\n<\/ol>\n<p><h2>\u5341\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728DOS\u73af\u5883\u4e2d\u8f7b\u677e\u8fdb\u5165Python\uff0c\u5e76\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<strong>\u786e\u4fdd\u6b63\u786e\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\u548c\u865a\u62df\u73af\u5883<\/strong>\uff0c\u8fd9\u4e9b\u90fd\u662f\u6210\u529f\u8fdb\u5165\u548c\u4f7f\u7528Python\u7684\u5173\u952e\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u591f\u5e2e\u52a9\u4f60\u987a\u5229\u5f00\u59cbPython\u7f16\u7a0b\u4e4b\u65c5\uff0c\u5e76\u89e3\u51b3\u5728\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728DOS\u4e2d\u542f\u52a8Python\uff1f<\/strong><br \/>\u5728DOS\u73af\u5883\u4e2d\u542f\u52a8Python\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5b8c\u6210\u3002\u9996\u5148\uff0c\u786e\u4fddPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\uff0c\u5e76\u4e14Python\u7684\u5b89\u88c5\u8def\u5f84\u5df2\u7ecf\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python --version<\/code>\uff0c\u5982\u679c\u770b\u5230Python\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u82e5\u8981\u8fd0\u884cPython\u811a\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>python your_script.py<\/code>\uff0c\u5176\u4e2d<code>your_script.py<\/code>\u662f\u4f60\u7684Python\u6587\u4ef6\u540d\u3002<\/p>\n<p><strong>\u5728DOS\u4e2d\u5982\u4f55\u8bbe\u7f6ePython\u73af\u5883\u53d8\u91cf\uff1f<\/strong><br \/>\u4e3a\u4e86\u5728\u4efb\u4f55\u76ee\u5f55\u4e0b\u65b9\u4fbf\u5730\u8fd0\u884cPython\uff0c\u9700\u5c06\u5176\u5b89\u88c5\u8def\u5f84\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u53f3\u952e\u70b9\u51fb\u201c\u6211\u7684\u7535\u8111\u201d\u6216\u201c\u6b64\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u8fdb\u5165\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\uff0c\u9009\u62e9\u201c\u7f16\u8f91\u201d\uff0c\u7136\u540e\u6dfb\u52a0Python\u7684\u5b89\u88c5\u8def\u5f84\uff08\u901a\u5e38\u662f<code>C:\\PythonXX<\/code>\uff0cXX\u4e3a\u7248\u672c\u53f7\uff09\u3002\u4fdd\u5b58\u66f4\u6539\u540e\uff0c\u91cd\u65b0\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u5373\u53ef\u751f\u6548\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u5728DOS\u4e0b\u8fd0\u884cPython\u7684\u56fe\u5f62\u754c\u9762\u7a0b\u5e8f\uff1f<\/strong><br \/>DOS\u73af\u5883\u4e3b\u8981\u662f\u547d\u4ee4\u884c\u754c\u9762\uff0c\u8fd0\u884cPython\u7684\u56fe\u5f62\u754c\u9762\u7a0b\u5e8f\uff08\u5982Tkinter\u6216Pygame\u521b\u5efa\u7684\u5e94\u7528\uff09\u53ef\u80fd\u4f1a\u9047\u5230\u9650\u5236\u3002\u5c3d\u7ba1\u53ef\u4ee5\u5728DOS\u4e0b\u8fd0\u884cPython\u4ee3\u7801\uff0c\u4f46\u56fe\u5f62\u754c\u9762\u901a\u5e38\u9700\u8981\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u56fe\u5f62\u652f\u6301\u3002\u5efa\u8bae\u5728Windows\u7684\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\u4e2d\u8fd0\u884c\u8fd9\u4e9b\u7a0b\u5e8f\uff0c\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u517c\u5bb9\u6027\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u7528DOS\u8fdb\u5165Python\uff0c\u6709\u51e0\u4e2a\u6b65\u9aa4\u9700\u8981\u9075\u5faa\uff1a\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\uff08CMD\uff09\u5e76\u8f93\u5165 [&hellip;]","protected":false},"author":3,"featured_media":1024664,"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\/1024661"}],"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=1024661"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1024661\/revisions"}],"predecessor-version":[{"id":1024665,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1024661\/revisions\/1024665"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1024664"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1024661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1024661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1024661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}