{"id":595,"date":"2025-10-23T15:43:26","date_gmt":"2025-10-23T07:43:26","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=595"},"modified":"2025-10-23T15:43:26","modified_gmt":"2025-10-23T07:43:26","slug":"python3-%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/10\/23\/python3-%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba\/","title":{"rendered":"Python3\u00a0\u73af\u5883\u642d\u5efa"},"content":{"rendered":"\n<p>\u672c\u7ae0\u8282\u6211\u4eec\u5c06\u5411\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728\u672c\u5730\u642d\u5efa Python3 \u5f00\u53d1\u73af\u5883\u3002<\/p>\n\n\n\n<p>Python3 \u53ef\u5e94\u7528\u4e8e\u591a\u5e73\u53f0\u5305\u62ec Windows\u3001Linux \u548c Mac OS X\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unix (Solaris, Linux, FreeBSD, AIX, HP\/UX, SunOS, IRIX, \u7b49\u7b49\u3002)<\/li>\n\n\n\n<li>Win 9x\/NT\/2000<\/li>\n\n\n\n<li>Macintosh (Intel, PPC, 68K)<\/li>\n\n\n\n<li>OS\/2<\/li>\n\n\n\n<li>DOS (\u591a\u4e2aDOS\u7248\u672c)<\/li>\n\n\n\n<li>PalmOS<\/li>\n\n\n\n<li>Nokia \u79fb\u52a8\u624b\u673a<\/li>\n\n\n\n<li>Windows CE<\/li>\n\n\n\n<li>Acorn\/RISC OS<\/li>\n\n\n\n<li>BeOS<\/li>\n\n\n\n<li>Amiga<\/li>\n\n\n\n<li>VMS\/OpenVMS<\/li>\n\n\n\n<li>QNX<\/li>\n\n\n\n<li>VxWorks<\/li>\n\n\n\n<li>Psion<\/li>\n\n\n\n<li>Python \u540c\u6837\u53ef\u4ee5\u79fb\u690d\u5230 Java \u548c .NET \u865a\u62df\u673a\u4e0a\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Python3 \u4e0b\u8f7d<\/h2>\n\n\n\n<p>Python3 \u6700\u65b0\u6e90\u7801\uff0c\u4e8c\u8fdb\u5236\u6587\u6863\uff0c\u65b0\u95fb\u8d44\u8baf\u7b49\u53ef\u4ee5\u5728 Python \u7684\u5b98\u7f51\u67e5\u770b\u5230\uff1a<\/p>\n\n\n\n<p>Python \u5b98\u7f51\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.python.org\/\" target=\"_blank\">https:\/\/www.python.org\/<\/a><\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u5728\u4ee5\u4e0b\u94fe\u63a5\u4e2d\u4e0b\u8f7d Python \u7684\u6587\u6863\uff0c\u4f60\u53ef\u4ee5\u4e0b\u8f7d HTML\u3001PDF \u548c PostScript \u7b49\u683c\u5f0f\u7684\u6587\u6863\u3002<\/p>\n\n\n\n<p>Python\u6587\u6863\u4e0b\u8f7d\u5730\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.python.org\/doc\/\" target=\"_blank\">https:\/\/www.python.org\/doc\/<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Python \u5b89\u88c5<\/h2>\n\n\n\n<p>Python \u5df2\u7ecf\u88ab\u79fb\u690d\u5728\u8bb8\u591a\u5e73\u53f0\u4e0a\uff08\u7ecf\u8fc7\u6539\u52a8\u4f7f\u5b83\u80fd\u591f\u5de5\u4f5c\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\uff09\u3002<\/p>\n\n\n\n<p>\u60a8\u9700\u8981\u4e0b\u8f7d\u9002\u7528\u4e8e\u60a8\u4f7f\u7528\u5e73\u53f0\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\uff0c\u7136\u540e\u5b89\u88c5 Python\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u5e73\u53f0\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\u662f\u4e0d\u53ef\u7528\u7684\uff0c\u4f60\u9700\u8981\u4f7f\u7528C\u7f16\u8bd1\u5668\u624b\u52a8\u7f16\u8bd1\u6e90\u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u7f16\u8bd1\u7684\u6e90\u4ee3\u7801\uff0c\u529f\u80fd\u4e0a\u6709\u66f4\u591a\u7684\u9009\u62e9\u6027\uff0c \u4e3a Python \u5b89\u88c5\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u5404\u4e2a\u5e73\u53f0\u5b89\u88c5\u5305\u7684\u4e0b\u8f7d\u5730\u5740\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/07\/F2135662-1078-4EE2-BEBB-353F8D8E521F.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Source Code<\/strong>&nbsp;\u53ef\u7528\u4e8e Linux \u4e0a\u7684\u5b89\u88c5\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a\u4e0d\u540c\u5e73\u53f0\u4e0a\u5b89\u88c5 Python3 \u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unix &amp; Linux \u5e73\u53f0\u5b89\u88c5 Python3:<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a\u5728 Unix &amp; Linux \u5e73\u53f0\u4e0a\u5b89\u88c5 Python \u7684\u7b80\u5355\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6253\u5f00 WEB \u6d4f\u89c8\u5668\u8bbf\u95ee\u00a0<a href=\"https:\/\/www.python.org\/downloads\/source\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.python.org\/downloads\/source\/<\/a><\/li>\n\n\n\n<li>\u9009\u62e9\u9002\u7528\u4e8e Unix\/Linux \u7684\u6e90\u7801\u538b\u7f29\u5305\u3002<\/li>\n\n\n\n<li>\u4e0b\u8f7d\u53ca\u89e3\u538b\u538b\u7f29\u5305\u00a0<strong>Python-3.x.x.tgz<\/strong>\uff0c<strong>3.x.x<\/strong>\u00a0\u4e3a\u4f60\u4e0b\u8f7d\u7684\u5bf9\u5e94\u7248\u672c\u53f7\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u4f60\u9700\u8981\u81ea\u5b9a\u4e49\u4e00\u4e9b\u9009\u9879\u4fee\u6539\u00a0<em>Modules\/Setup<\/em><\/li>\n<\/ul>\n\n\n\n<p>\u4ee5<strong>&nbsp;Python3.6.1<\/strong>&nbsp;\u7248\u672c\u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># tar -zxvf Python-3.6.1.tgz\n# cd Python-3.6.1\n# .\/configure\n# make &amp;&amp; make install<\/pre>\n\n\n\n<p>\u68c0\u67e5 Python3 \u662f\u5426\u6b63\u5e38\u53ef\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># python3 -V\nPython 3.6.1<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Window \u5e73\u53f0\u5b89\u88c5 Python:<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a\u5728 Window \u5e73\u53f0\u4e0a\u5b89\u88c5 Python \u7684\u7b80\u5355\u6b65\u9aa4\u3002<\/p>\n\n\n\n<p>\u6253\u5f00 WEB \u6d4f\u89c8\u5668\u8bbf\u95ee&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.python.org\/downloads\/windows\/\" target=\"_blank\">https:\/\/www.python.org\/downloads\/windows\/<\/a>&nbsp;\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/07\/1bf7d20f853bf2c4a8f03c03c864982f.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u8fd9\u4e9b\u94fe\u63a5\u63d0\u4f9b\u4e86\u4e0d\u540c\u7c7b\u578b\u7684 Python \u5b89\u88c5\u6587\u4ef6\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684 Windows \u7cfb\u7edf\u548c\u4f7f\u7528\u60c5\u666f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Download Windows installer (64-bit)<\/strong>\uff1a64 \u4f4d Windows \u7cfb\u7edf\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li><strong>Download Windows installer (ARM64)<\/strong>\uff1a\u9002\u7528\u4e8e ARM64 \u67b6\u6784\u7684 Windows \u8bbe\u5907\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li><strong>Download Windows embeddable package (64-bit)<\/strong>\uff1a64 \u4f4d Windows \u7cfb\u7edf\u7684\u5d4c\u5165\u5f0f\u5305\uff0c\u53ef\u7528\u4e8e\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/li>\n\n\n\n<li><strong>Download Windows embeddable package (32-bit)<\/strong>\uff1a32 \u4f4d Windows \u7cfb\u7edf\u7684\u5d4c\u5165\u5f0f\u5305\uff0c\u540c\u6837\u53ef\u7528\u4e8e\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/li>\n\n\n\n<li><strong>Download Windows embeddable package (ARM64)<\/strong>\uff1a\u9002\u7528\u4e8e ARM64 \u67b6\u6784\u7684 Windows \u8bbe\u5907\u7684\u5d4c\u5165\u5f0f\u5305\u3002<\/li>\n\n\n\n<li><strong>Download Windows installer (32-bit)<\/strong>\uff1a32 \u4f4d Windows \u7cfb\u7edf\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8bb0\u5f97\u52fe\u9009&nbsp;<strong>Add Python 3.6 to PATH<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/07\/20180226150011548.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u6309&nbsp;<strong>Win+R<\/strong>&nbsp;\u952e\uff0c\u8f93\u5165 cmd \u8c03\u51fa\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165 python:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/07\/20170707155742110.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22&nbsp;<strong>IDLE<\/strong>\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/07\/460F6DFB-3BBF-4683-BEA0-23BE8DF021B0.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">MAC \u5e73\u53f0\u5b89\u88c5 Python:<\/h3>\n\n\n\n<p>MAC \u7cfb\u7edf\u90fd\u81ea\u5e26\u6709 Python2.7 \u73af\u5883\uff0c\u4f60\u53ef\u4ee5\u5728\u94fe\u63a5&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.python.org\/downloads\/mac-osx\/\" target=\"_blank\">https:\/\/www.python.org\/downloads\/mac-osx\/<\/a>&nbsp;\u4e0a\u4e0b\u8f7d\u6700\u65b0\u7248\u5b89\u88c5 Python 3.x\u3002<\/p>\n\n\n\n<p>\u4f60\u4e5f\u53ef\u4ee5\u53c2\u8003\u6e90\u7801\u5b89\u88c5\u7684\u65b9\u5f0f\u6765\u5b89\u88c5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/h2>\n\n\n\n<p>\u7a0b\u5e8f\u548c\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u5728\u8bb8\u591a\u76ee\u5f55\uff0c\u800c\u8fd9\u4e9b\u8def\u5f84\u5f88\u53ef\u80fd\u4e0d\u5728\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u53ef\u6267\u884c\u6587\u4ef6\u7684\u641c\u7d22\u8def\u5f84\u4e2d\u3002<\/p>\n\n\n\n<p>path(\u8def\u5f84)\u5b58\u50a8\u5728\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u8fd9\u662f\u7531\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4\u7684\u4e00\u4e2a\u547d\u540d\u7684\u5b57\u7b26\u4e32\u3002\u8fd9\u4e9b\u53d8\u91cf\u5305\u542b\u53ef\u7528\u7684\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u548c\u5176\u4ed6\u7a0b\u5e8f\u7684\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>Unix \u6216 Windows \u4e2d\u8def\u5f84\u53d8\u91cf\u4e3a PATH\uff08UNIX \u533a\u5206\u5927\u5c0f\u5199\uff0cWindows \u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\u3002<\/p>\n\n\n\n<p>\u5728 Mac OS \u4e2d\uff0c\u5b89\u88c5\u7a0b\u5e8f\u8fc7\u7a0b\u4e2d\u6539\u53d8\u4e86 Python \u7684\u5b89\u88c5\u8def\u5f84\u3002\u5982\u679c\u4f60\u9700\u8981\u5728\u5176\u4ed6\u76ee\u5f55\u5f15\u7528 Python\uff0c\u4f60\u5fc5\u987b\u5728 path \u4e2d\u6dfb\u52a0 Python \u76ee\u5f55\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5728 Unix\/Linux \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5728 csh shell:<\/strong>\u00a0\u8f93\u5165<br>setenv PATH &#8220;$PATH:\/usr\/local\/bin\/python&#8221;, \u6309\u4e0b\u00a0<strong>Enter<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u5728 bash shell (Linux) \u8f93\u5165 :<\/strong><br>export PATH=&#8221;$PATH:\/usr\/local\/bin\/python&#8221; \u6309\u4e0b\u00a0<strong>Enter<\/strong>\u00a0\u3002<\/li>\n\n\n\n<li><strong>\u5728 sh \u6216\u8005 ksh shell \u8f93\u5165:<\/strong><br>PATH=&#8221;$PATH:\/usr\/local\/bin\/python&#8221; \u6309\u4e0b Enter\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u6ce8\u610f:&nbsp;<\/strong>\/usr\/local\/bin\/python \u662f Python \u7684\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5728 Windows \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n\n\n\n<p>\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u6dfb\u52a0Python\u76ee\u5f55\uff1a<\/p>\n\n\n\n<p><strong>\u5728\u547d\u4ee4\u63d0\u793a\u6846\u4e2d(cmd) :<\/strong>&nbsp;\u8f93\u5165<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">path=%path%;C:\\Python <\/pre>\n\n\n\n<p>\u6309\u4e0b&#8221;Enter&#8221;\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u610f:&nbsp;<\/strong>C:\\Python \u662fPython\u7684\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53f3\u952e\u70b9\u51fb&#8221;\u8ba1\u7b97\u673a&#8221;\uff0c\u7136\u540e\u70b9\u51fb&#8221;\u5c5e\u6027&#8221;<\/li>\n\n\n\n<li>\u7136\u540e\u70b9\u51fb&#8221;\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e&#8221;<\/li>\n\n\n\n<li>\u9009\u62e9&#8221;\u7cfb\u7edf\u53d8\u91cf&#8221;\u7a97\u53e3\u4e0b\u9762\u7684&#8221;Path&#8221;,\u53cc\u51fb\u5373\u53ef\uff01<\/li>\n\n\n\n<li><\/li>\n\n\n\n<li>\u7136\u540e\u5728&#8221;Path&#8221;\u884c\uff0c\u6dfb\u52a0python\u5b89\u88c5\u8def\u5f84\u5373\u53ef(\u6211\u7684D:\\Python32)\uff0c\u6240\u4ee5\u5728\u540e\u9762\uff0c\u6dfb\u52a0\u8be5\u8def\u5f84\u5373\u53ef\u3002\u00a0<strong>ps\uff1a\u8bb0\u4f4f\uff0c\u8def\u5f84\u76f4\u63a5\u7528\u5206\u53f7&#8221;\uff1b&#8221;\u9694\u5f00\uff01<\/strong><\/li>\n\n\n\n<li>\u6700\u540e\u8bbe\u7f6e\u6210\u529f\u4ee5\u540e\uff0c\u5728cmd\u547d\u4ee4\u884c\uff0c\u8f93\u5165\u547d\u4ee4&#8221;python&#8221;\uff0c\u5c31\u53ef\u4ee5\u6709\u76f8\u5173\u663e\u793a\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/201209201707594792.png\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Python \u73af\u5883\u53d8\u91cf<\/h2>\n\n\n\n<p>\u4e0b\u9762\u51e0\u4e2a\u91cd\u8981\u7684\u73af\u5883\u53d8\u91cf\uff0c\u5b83\u5e94\u7528\u4e8ePython\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u53d8\u91cf\u540d<\/th><th>\u63cf\u8ff0<\/th><\/tr><tr><td>PYTHONPATH<\/td><td>PYTHONPATH\u662fPython\u641c\u7d22\u8def\u5f84\uff0c\u9ed8\u8ba4\u6211\u4eecimport\u7684\u6a21\u5757\u90fd\u4f1a\u4ecePYTHONPATH\u91cc\u9762\u5bfb\u627e\u3002<\/td><\/tr><tr><td>PYTHONSTARTUP<\/td><td>Python\u542f\u52a8\u540e\uff0c\u5148\u5bfb\u627ePYTHONSTARTUP\u73af\u5883\u53d8\u91cf\uff0c\u7136\u540e\u6267\u884c\u6b64\u53d8\u91cf\u6307\u5b9a\u7684\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u3002<\/td><\/tr><tr><td>PYTHONCASEOK<\/td><td>\u52a0\u5165PYTHONCASEOK\u7684\u73af\u5883\u53d8\u91cf, \u5c31\u4f1a\u4f7fpython\u5bfc\u5165\u6a21\u5757\u7684\u65f6\u5019\u4e0d\u533a\u5206\u5927\u5c0f\u5199.<\/td><\/tr><tr><td>PYTHONHOME<\/td><td>\u53e6\u4e00\u79cd\u6a21\u5757\u641c\u7d22\u8def\u5f84\u3002\u5b83\u901a\u5e38\u5185\u5d4c\u4e8e\u7684PYTHONSTARTUP\u6216PYTHONPATH\u76ee\u5f55\u4e2d\uff0c\u4f7f\u5f97\u4e24\u4e2a\u6a21\u5757\u5e93\u66f4\u5bb9\u6613\u5207\u6362\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fd0\u884c Python<\/h2>\n\n\n\n<p>\u6709\u4e09\u79cd\u65b9\u5f0f\u53ef\u4ee5\u8fd0\u884c Python\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1\u3001\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff1a<\/h3>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u7a97\u53e3\u8fdb\u5165 Python \u5e76\u5f00\u59cb\u5728\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u4e2d\u5f00\u59cb\u7f16\u5199 Python \u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u5728 Unix\u3001DOS \u6216\u4efb\u4f55\u5176\u4ed6\u63d0\u4f9b\u4e86\u547d\u4ee4\u884c\u6216\u8005 shell \u7684\u7cfb\u7edf\u8fdb\u884c Python \u7f16\u7801\u5de5\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ python             # Unix\/Linux\n\n\u6216\u8005  \n\nC:&gt;python           # Windows\/DOS<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a Python \u547d\u4ee4\u884c\u53c2\u6570\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u9009\u9879<\/th><th>\u63cf\u8ff0<\/th><\/tr><tr><td>-d<\/td><td>\u5728\u89e3\u6790\u65f6\u663e\u793a\u8c03\u8bd5\u4fe1\u606f<\/td><\/tr><tr><td>-O<\/td><td>\u751f\u6210\u4f18\u5316\u4ee3\u7801 ( .pyo \u6587\u4ef6 )<\/td><\/tr><tr><td>-S<\/td><td>\u542f\u52a8\u65f6\u4e0d\u5f15\u5165\u67e5\u627ePython\u8def\u5f84\u7684\u4f4d\u7f6e<\/td><\/tr><tr><td>-V<\/td><td>\u8f93\u51faPython\u7248\u672c\u53f7<\/td><\/tr><tr><td>-X<\/td><td>\u4ece 1.6\u7248\u672c\u4e4b\u540e\u57fa\u4e8e\u5185\u5efa\u7684\u5f02\u5e38\uff08\u4ec5\u4ec5\u7528\u4e8e\u5b57\u7b26\u4e32\uff09\u5df2\u8fc7\u65f6\u3002<\/td><\/tr><tr><td>-c cmd<\/td><td>\u6267\u884c Python \u811a\u672c\uff0c\u5e76\u5c06\u8fd0\u884c\u7ed3\u679c\u4f5c\u4e3a cmd \u5b57\u7b26\u4e32\u3002<\/td><\/tr><tr><td>file<\/td><td>\u5728\u7ed9\u5b9a\u7684python\u6587\u4ef6\u6267\u884cpython\u811a\u672c\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2\u3001\u547d\u4ee4\u884c\u811a\u672c<\/h3>\n\n\n\n<p>\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u901a\u8fc7\u5f15\u5165\u89e3\u91ca\u5668\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884cPython\u811a\u672c\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ python  script.py          # Unix\/Linux\n\n\u6216\u8005\n\nC:&gt;python script.py         # Windows\/DOS<\/pre>\n\n\n\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u5728\u6267\u884c\u811a\u672c\u65f6\uff0c\u8bf7\u68c0\u67e5\u811a\u672c\u662f\u5426\u6709\u53ef\u6267\u884c\u6743\u9650\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff1aIntegrated Development Environment\uff09: PyCharm<\/h3>\n\n\n\n<p>PyCharm \u662f\u7531 JetBrains \u6253\u9020\u7684\u4e00\u6b3e Python IDE\uff0c\u652f\u6301 macOS\u3001 Windows\u3001 Linux \u7cfb\u7edf\u3002<\/p>\n\n\n\n<p>PyCharm \u529f\u80fd : \u8c03\u8bd5\u3001\u8bed\u6cd5\u9ad8\u4eae\u3001Project\u7ba1\u7406\u3001\u4ee3\u7801\u8df3\u8f6c\u3001\u667a\u80fd\u63d0\u793a\u3001\u81ea\u52a8\u5b8c\u6210\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u7248\u672c\u63a7\u5236\u2026\u2026<\/p>\n\n\n\n<p>PyCharm \u4e0b\u8f7d\u5730\u5740 :&nbsp;<a href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.jetbrains.com\/pycharm\/download\/<\/a><\/p>\n\n\n\n<p>PyCharm \u5b89\u88c5\u5730\u5740\uff1a<a href=\"https:\/\/www.runoob.com\/pycharm\/pycharm-install.html\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/www.runoob.com\/pycharm\/pycharm-install.html<\/a><\/p>\n\n\n\n<p>Professional\uff08\u4e13\u4e1a\u7248\uff0c\u6536\u8d39\uff09\uff1a\u5b8c\u6574\u7684\u529f\u80fd\uff0c\u53ef\u8bd5\u7528 30 \u5929\u3002<\/p>\n\n\n\n<p>Community\uff08\u793e\u533a\u7248\uff0c\u514d\u8d39\uff09\uff1a\u9609\u5272\u7248\u7684\u4e13\u4e1a\u7248\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2018\/05\/1525863037-6053-.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>PyCharm \u754c\u9762\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/execute-python-hello-world-program.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5b89\u88c5 PyCharm \u4e2d\u6587\u63d2\u4ef6\uff0c\u6253\u5f00\u83dc\u5355\u680f File\uff0c\u9009\u62e9 Settings\uff0c\u7136\u540e\u9009 Plugins\uff0c\u70b9 Marketplace\uff0c\u641c\u7d22 chinese\uff0c\u7136\u540e\u70b9\u51fb install \u5b89\u88c5\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2013\/11\/aHR0cDovL3d3dy54aW1vcWluZy5jbi9kYXRhL3VwbG9hZHMvMjAyMDA0MjIvNTY1ODA1NTIyNDhhYTIwNmQzZThiMTQzNDVlZjc2NjEuanBn.jpeg\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Anaconda \u96c6\u6210\u73af\u5883<\/h2>\n\n\n\n<p>Anaconda \u53d1\u884c\u7248\u5305\u542b\u4e86 Python\u3002<\/p>\n\n\n\n<p>Anaconda \u662f\u4e00\u4e2a\u96c6\u6210\u7684\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u73af\u5883\uff0c\u5176\u4e2d\u5305\u62ec\u4e86 Python \u89e3\u91ca\u5668\u4ee5\u53ca\u5927\u91cf\u5e38\u7528\u7684\u6570\u636e\u79d1\u5b66\u5e93\u548c\u5de5\u5177\u3002<\/p>\n\n\n\n<p>Anaconda \u5305\u53ca\u5176\u4f9d\u8d56\u9879\u548c\u73af\u5883\u7684\u7ba1\u7406\u5de5\u5177\u4e3a conda \u547d\u4ee4\uff0c\u6587\u4e0e\u4f20\u7edf\u7684 Python pip \u5de5\u5177\u76f8\u6bd4 Anaconda \u7684conda \u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u5728\u4e0d\u540c\u73af\u5883\u4e4b\u95f4\u8fdb\u884c\u5207\u6362\uff0c\u73af\u5883\u7ba1\u7406\u8f83\u4e3a\u7b80\u5355\u3002<\/p>\n\n\n\n<p>Anaconda \u8be6\u7ec6\u5b89\u88c5\u4e0e\u4ecb\u7ecd\u53c2\u8003\uff1a<a href=\"https:\/\/www.runoob.com\/python-qt\/anaconda-tutorial.html\" rel=\"noreferrer noopener\" target=\"_blank\">Anaconda \u6559\u7a0b\u3002<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>uv<\/strong>&nbsp;&#8212; Python \u5305\u4e0e\u73af\u5883\u7ba1\u7406\u5de5\u5177<\/h2>\n\n\n\n<p>uv \u662f\u7531 Astral \u516c\u53f8\u5f00\u53d1\u7684\u4e00\u6b3e Rust \u7f16\u5199\u7684 Python \u5305\u7ba1\u7406\u5668\u548c\u73af\u5883\u7ba1\u7406\u5668\uff0c\u5b83\u7684\u4e3b\u8981\u76ee\u6807\u662f\u63d0\u4f9b\u6bd4\u73b0\u6709\u5de5\u5177\u5feb 10-100 \u500d\u7684\u6027\u80fd\uff0c\u540c\u65f6\u4fdd\u6301\u7b80\u5355\u76f4\u89c2\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n\n\n\n<p>uv \u53ef\u4ee5\u66ff\u4ee3 pip\u3001virtualenv\u3001pip-tools \u7b49\u5de5\u5177\uff0c\u63d0\u4f9b\u4f9d\u8d56\u7ba1\u7406\u3001\u865a\u62df\u73af\u5883\u521b\u5efa\u3001Python \u7248\u672c\u7ba1\u7406\u7b49\u4e00\u7ad9\u5f0f\u670d\u52a1\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7ae0\u8282\u6211\u4eec\u5c06\u5411\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728\u672c\u5730\u642d\u5efa Python3 \u5f00\u53d1\u73af\u5883\u3002 P&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"views":2310,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=595"}],"version-history":[{"count":1,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/595\/revisions"}],"predecessor-version":[{"id":596,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/595\/revisions\/596"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/471"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}