{"id":1149738,"date":"2025-01-13T16:53:13","date_gmt":"2025-01-13T08:53:13","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1149738.html"},"modified":"2025-01-13T16:53:15","modified_gmt":"2025-01-13T08:53:15","slug":"python%e5%ae%89%e8%a3%85%e5%90%8e%e5%a6%82%e4%bd%95%e5%90%af%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1149738.html","title":{"rendered":"python\u5b89\u88c5\u540e\u5982\u4f55\u542f\u52a8"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25180355\/913c013d-ada9-4ace-9b22-f2641dbccf8d.webp\" alt=\"python\u5b89\u88c5\u540e\u5982\u4f55\u542f\u52a8\" \/><\/p>\n<p><p> \u5728\u5b89\u88c5Python\u4e4b\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<strong>\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/strong>\u7b49\u65b9\u5f0f\u542f\u52a8Python\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\uff0c\u5373\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u3002<\/p>\n<\/p>\n<p><p>\u8981\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\uff0c\u8bf7\u6309\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762<\/strong>\uff1a\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0b<code>Win+R<\/code>\u952e\u5e76\u8f93\u5165<code>cmd<\/code>\u6765\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1b\u5728macOS\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0b<code>Cmd+\u7a7a\u683c<\/code>\u952e\u5e76\u8f93\u5165<code>Terminal<\/code>\u6765\u6253\u5f00\u7ec8\u7aef\uff1b\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u7ec8\u7aef\u7a0b\u5e8f\u3002<\/li>\n<li><strong>\u9a8c\u8bc1Python\u5b89\u88c5<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u8fd9\u5c06\u663e\u793a\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u5982\u679c\u663e\u793a\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8868\u793aPython\u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/li>\n<li><strong>\u542f\u52a8Python\u89e3\u91ca\u5668<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b<code>Enter<\/code>\u952e\u3002\u8fd9\u5c06\u542f\u52a8Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u5728\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/li>\n<\/ol>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u7684\u65b9\u6cd5\u4ee5\u53ca\u5176\u4ed6\u542f\u52a8Python\u7684\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python<\/h3>\n<\/p>\n<p><h4>1. \u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762<\/h4>\n<\/p>\n<p><p>\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762\u7684\u65b9\u5f0f\u7565\u6709\u4e0d\u540c\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>Windows<\/strong>\uff1a\u6309\u4e0b<code>Win+R<\/code>\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\u5e76\u6309\u4e0b<code>Enter<\/code>\u952e\uff0c\u6216\u8005\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\u641c\u7d22\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u5e76\u6253\u5f00\u3002<\/li>\n<li><strong>macOS<\/strong>\uff1a\u6309\u4e0b<code>Cmd+\u7a7a\u683c<\/code>\u952e\uff0c\u8f93\u5165<code>Terminal<\/code>\u5e76\u6309\u4e0b<code>Enter<\/code>\u952e\uff0c\u6216\u8005\u901a\u8fc7\u542f\u52a8\u53f0\uff08Launchpad\uff09\u4e2d\u7684\u201c\u5176\u4ed6\u201d\u6587\u4ef6\u5939\u627e\u5230\u5e76\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u3002<\/li>\n<li><strong>Linux<\/strong>\uff1a\u901a\u5e38\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u5e76\u6253\u5f00\u201c\u7ec8\u7aef\u201d\uff0c\u6216\u8005\u6309\u4e0b\u5feb\u6377\u952e\uff08\u5982<code>Ctrl+Alt+T<\/code>\uff09\u6253\u5f00\u7ec8\u7aef\u3002<\/li>\n<\/ul>\n<p><h4>2. \u9a8c\u8bc1Python\u5b89\u88c5<\/h4>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4e4b\u4e00\uff0c\u4ee5\u786e\u4fddPython\u5df2\u6b63\u786e\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679cPython\u5df2\u6b63\u786e\u5b89\u88c5\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5c06\u663e\u793a\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">Python 3.9.7<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u542f\u52a8Python\u89e3\u91ca\u5668<\/h4>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4e4b\u4e00\uff0c\u7136\u540e\u6309\u4e0b<code>Enter<\/code>\u952e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u542f\u52a8Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u7684\u63d0\u793a\u7b26\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">Python 3.9.7 (default, Aug 31 2021, 13:28:12) <\/p>\n<p>[GCC 7.5.0] on linux<\/p>\n<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<\/p>\n<p>&gt;&gt;&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u63d0\u793a\u7b26\u4e0b\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u5e76\u6309\u4e0b<code>Enter<\/code>\u952e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u542f\u52a8Python<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002\u5e38\u89c1\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001Jupyter Notebook\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u4e00\u4e2a\u6d41\u884c\u7684Python IDE\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u5de5\u5177\u6765\u5e2e\u52a9\u5f00\u53d1\u8005\u7f16\u5199\u3001\u8c03\u8bd5\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyCharm\u542f\u52a8Python\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/li>\n<li>\u542f\u52a8PyCharm\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff08\u4f8b\u5982\uff0c<code>m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n.py<\/code>\uff09\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li>\u53f3\u952e\u70b9\u51fb\u6587\u4ef6\u5e76\u9009\u62e9\u201c\u8fd0\u884c\u201d\uff08Run\uff09\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Shift+F10<\/code>\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ol>\n<p><h4>2. \u4f7f\u7528Visual Studio Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code\uff08VS Code\uff09\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528VS Code\u542f\u52a8Python\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Visual Studio Code\u3002<\/li>\n<li>\u5b89\u88c5Python\u6269\u5c55\uff08\u53ef\u4ee5\u5728VS Code\u7684\u6269\u5c55\u5e02\u573a\u4e2d\u627e\u5230\uff09\u3002<\/li>\n<li>\u542f\u52a8VS Code\u5e76\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\u5939\u6216\u5de5\u4f5c\u533a\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff08\u4f8b\u5982\uff0c<code>main.py<\/code>\uff09\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"6\">\n<li>\u53f3\u952e\u70b9\u51fb\u6587\u4ef6\u5e76\u9009\u62e9\u201c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u6587\u4ef6\u201d\uff08Run Python File in Terminal\uff09\uff0c\u6216\u8005\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+Shift+P<\/code>\u6253\u5f00\u547d\u4ee4\u9762\u677f\u5e76\u9009\u62e9\u201cPython: \u8fd0\u884cPython\u6587\u4ef6\u201d\uff08Python: Run Python File\uff09\u3002<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u901a\u8fc7\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u542f\u52a8Python<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u901a\u8fc7\u547d\u4ee4\u884c\u548cIDE\u542f\u52a8Python\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u6765\u6267\u884cPython\u4ee3\u7801\u3002\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u5feb\u901f\u6d4b\u8bd5\u548c\u8c03\u8bd5Python\u4ee3\u7801\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528IDLE<\/h4>\n<\/p>\n<p><p>IDLE\u662fPython\u81ea\u5e26\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u7f16\u8f91\u5668\u548c\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528IDLE\u542f\u52a8Python\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00IDLE\uff08\u53ef\u4ee5\u5728\u5f00\u59cb\u83dc\u5355\u6216\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\uff09\u3002<\/li>\n<li>\u5728IDLE\u7684\u7f16\u8f91\u5668\u7a97\u53e3\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u9009\u62e9\u201c\u8fd0\u884c\u201d\uff08Run\uff09\u83dc\u5355\u5e76\u9009\u62e9\u201c\u8fd0\u884c\u6a21\u5757\u201d\uff08Run Module\uff09\uff0c\u6216\u8005\u6309\u4e0b<code>F5<\/code>\u952e\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ol>\n<p><h4>2. \u4f7f\u7528Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u4e2a\u57fa\u4e8eWeb\u7684\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Jupyter Notebook\u542f\u52a8Python\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Jupyter Notebook\uff08\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\uff1a<code>pip install notebook<\/code>\uff09\u3002<\/li>\n<li>\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2aWeb\u6d4f\u89c8\u5668\u7a97\u53e3\uff0c\u663e\u793aJupyter Notebook\u7684\u4e3b\u9875\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u7b14\u8bb0\u672c\uff08Notebook\uff09\uff0c\u5e76\u5728\u5355\u5143\u683c\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li>\u9009\u62e9\u5355\u5143\u683c\u5e76\u6309\u4e0b<code>Shift+Enter<\/code>\u952e\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u5176\u4ed6\u542f\u52a8Python\u7684\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u4e4b\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u542f\u52a8Python\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528\u811a\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u5c06Python\u4ee3\u7801\u4fdd\u5b58\u5728\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\u4e2d\uff0c\u5e76\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c\u8be5\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u5728\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u8be5\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3 script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528\u5728\u7ebf\u7f16\u8bd1\u5668<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4e0d\u60f3\u5728\u672c\u5730\u5b89\u88c5Python\uff0c\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u7f16\u8bd1\u5668\u6765\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002\u4f8b\u5982\uff0cRepl.it\u3001Google Colab\u548cOnlineGDB\u7b49\u7f51\u7ad9\u63d0\u4f9b\u4e86\u5728\u7ebfPython\u7f16\u8bd1\u5668\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u4e2d\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u4ecb\u7ecd\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230<strong>\u542f\u52a8Python<\/strong>\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec<strong>\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/strong>\u7b49\u3002\u4e0d\u540c\u7684\u65b9\u6cd5\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u573a\u666f\u548c\u9700\u6c42\u3002\u5bf9\u4e8e\u521d\u5b66\u8005\uff0c\u63a8\u8350\u4f7f\u7528\u547d\u4ee4\u884c\u6216IDLE\u6765\u542f\u52a8Python\uff1b\u5bf9\u4e8e\u6709\u4e00\u5b9a\u7f16\u7a0b\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005\uff0c\u53ef\u4ee5\u4f7f\u7528PyCharm\u6216VS Code\u7b49\u4e13\u4e1a\u7684IDE\uff1b\u5bf9\u4e8e\u9700\u8981\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528Jupyter Notebook\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u53ef\u4ee5\u8f7b\u677e\u542f\u52a8Python\u5e76\u5f00\u59cb\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5\u6211\u7684Python\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\uff08Windows\u4e2d\u4e3acmd\uff0cmacOS\u6216Linux\u4e2d\u4e3a\u7ec8\u7aef\uff09\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u786e\u8ba4Python\u662f\u5426\u5df2\u6b63\u786e\u5b89\u88c5\u3002\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u7cfb\u7edf\u5c06\u663e\u793a\u5f53\u524d\u7684Python\u7248\u672c\u53f7\u3002<\/p>\n<p><strong>\u542f\u52a8Python\u540e\u6211\u5e94\u8be5\u5982\u4f55\u8fd0\u884c\u4ee3\u7801\uff1f<\/strong><br \/>\u5728Python\u542f\u52a8\u540e\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee3\u7801\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002\u60a8\u4e5f\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u4ee5<code>.py<\/code>\u4e3a\u6269\u5c55\u540d\u7684Python\u6587\u4ef6\uff0c\u5728\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u7136\u540e\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python filename.py<\/code>\u6216<code>python3 filename.py<\/code>\u6765\u8fd0\u884c\u8be5\u6587\u4ef6\u3002<\/p>\n<p><strong>\u6211\u8be5\u5982\u4f55\u5b89\u88c5\u989d\u5916\u7684Python\u5e93\u6216\u6a21\u5757\uff1f<\/strong><br \/>\u4f7f\u7528<code>pip<\/code>\u5de5\u5177\u53ef\u4ee5\u8f7b\u677e\u5b89\u88c5\u989d\u5916\u7684\u5e93\u3002\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pip install package_name<\/code>\uff0c\u5c06<code>package_name<\/code>\u66ff\u6362\u4e3a\u60a8\u60f3\u8981\u5b89\u88c5\u7684\u5e93\u540d\u5373\u53ef\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u5b89\u88c5<code>requests<\/code>\u5e93\uff0c\u53ef\u4ee5\u8f93\u5165<code>pip install requests<\/code>\u3002\u786e\u4fdd\u5728\u5b89\u88c5\u4e4b\u524d\u5df2\u7ecf\u6b63\u786e\u914d\u7f6e\u4e86Python\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u5b89\u88c5Python\u4e4b\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u7b49\u65b9\u5f0f\u542f\u52a8Python\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6 [&hellip;]","protected":false},"author":3,"featured_media":1149743,"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\/1149738"}],"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=1149738"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1149738\/revisions"}],"predecessor-version":[{"id":1149745,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1149738\/revisions\/1149745"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1149743"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1149738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1149738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1149738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}