{"id":955001,"date":"2024-12-27T02:07:43","date_gmt":"2024-12-26T18:07:43","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/955001.html"},"modified":"2024-12-27T02:07:45","modified_gmt":"2024-12-26T18:07:45","slug":"%e5%a6%82%e4%bd%95%e6%9c%ac%e5%9c%b0%e8%bf%90%e8%a1%8cpython%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/955001.html","title":{"rendered":"\u5982\u4f55\u672c\u5730\u8fd0\u884cpython\u811a\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25095017\/87192535-d87b-483b-a73a-8501da187e58.webp\" alt=\"\u5982\u4f55\u672c\u5730\u8fd0\u884cpython\u811a\u672c\" \/><\/p>\n<p><p> <strong>\u8981\u5728\u672c\u5730\u8fd0\u884cPython\u811a\u672c\uff0c\u4f60\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u7f16\u5199Python\u811a\u672c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884c\u811a\u672c<\/strong>\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86Python\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u811a\u672c\uff0c\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\u3002\u6700\u540e\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u8fdb\u5165\u5230\u811a\u672c\u6240\u5728\u76ee\u5f55\uff0c\u4f7f\u7528<code>python script_name.py<\/code>\u547d\u4ee4\u8fd0\u884c\u811a\u672c\u3002<strong>\u786e\u4fddPython\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u6b63\u786e<\/strong>\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u547d\u4ee4\u884c\u65e0\u6cd5\u8bc6\u522bPython\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python\u89e3\u91ca\u5668<\/p>\n<\/p>\n<p><p>\u5728\u672c\u5730\u8fd0\u884cPython\u811a\u672c\u7684\u7b2c\u4e00\u6b65\u662f\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002Python\u662f\u8de8\u5e73\u53f0\u7684\uff0c\u53ef\u4ee5\u5728Windows\u3001macOS\u548cLinux\u4e0a\u8fd0\u884c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dPython<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E4%B8%8B%E8%BD%BD%E9%80%82%E5%90%88%E4%BD%A0%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84Python%E7%89%88%E6%9C%AC%E3%80%82\">https:\/\/www.python.org\/\uff09\uff0c\u4e0b\u8f7d\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\u3002<\/a><\/li>\n<li>\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u5efa\u8bae\u4e0b\u8f7d\u5b89\u88c5\u7a0b\u5e8f\uff08Installer\uff09\u7248\u672c\u3002\u5bf9\u4e8emacOS\u7528\u6237\uff0c\u53ef\u4ee5\u901a\u8fc7Homebrew\u5b89\u88c5Python\uff0c\u547d\u4ee4\u4e3a\uff1a<code>brew install python<\/code>\u3002<\/li>\n<li>Linux\u7528\u6237\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5de5\u5177\uff08\u5982apt\u3001yum\uff09\u76f4\u63a5\u5b89\u88c5Python\uff0c\u4f8b\u5982\u5728Ubuntu\u4e0a\u8fd0\u884c\uff1a<code>sudo apt-get install python3<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u4e0a\uff0c\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528<code>python<\/code>\u547d\u4ee4\u3002<\/li>\n<li>\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u5b8c\u6210\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u7f16\u5199Python\u811a\u672c<\/p>\n<\/p>\n<p><p>\u6709\u4e86Python\u89e3\u91ca\u5668\uff0c\u63a5\u4e0b\u6765\u4f60\u9700\u8981\u7f16\u5199Python\u811a\u672c\u3002Python\u811a\u672c\u662f\u5305\u542b\u4e00\u7cfb\u5217Python\u547d\u4ee4\u7684\u6587\u672c\u6587\u4ef6\uff0c\u6269\u5c55\u540d\u4e3a<code>.py<\/code>\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u6587\u672c\u7f16\u8f91\u5668<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u6765\u7f16\u5199Python\u811a\u672c\uff0c\u5982Notepad++\u3001Sublime Text\u3001Visual Studio Code\u3001PyCharm\u7b49\u3002<\/li>\n<li>\u9009\u62e9\u4e00\u4e2a\u4f60\u719f\u6089\u4e14\u8212\u9002\u7684\u7f16\u8f91\u5668\uff0c\u5c06\u6709\u52a9\u4e8e\u63d0\u9ad8\u7f16\u5199\u4ee3\u7801\u7684\u6548\u7387\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u4ee3\u7801<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u4f60\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u3002<\/li>\n<li>\u8f93\u5165Python\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u6253\u5370\u201cHello, World!\u201d\u7684\u7b80\u5355\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5c06\u6587\u4ef6\u4fdd\u5b58\u4e3a<code>.py<\/code>\u683c\u5f0f\uff0c\u5982<code>hello.py<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5b8c\u6210Python\u811a\u672c\u7684\u7f16\u5199\u540e\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\u6765\u6267\u884c\u5b83\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c\u5de5\u5177<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u6216PowerShell\u3002<\/li>\n<li>\u5728macOS\u548cLinux\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff08Terminal\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230\u811a\u672c\u76ee\u5f55<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u8fdb\u5165\u5230Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u811a\u672c\u4f4d\u4e8e\u684c\u9762\uff1a\n<ul>\n<li>Windows: <code>cd Desktop<\/code><\/li>\n<li>macOS\/Linux: <code>cd ~\/Desktop<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python script_name.py<\/code>\u6216<code>python3 script_name.py<\/code>\uff08\u53d6\u51b3\u4e8e\u4f60\u7684Python\u7248\u672c\u548c\u7cfb\u7edf\u914d\u7f6e\uff09\uff0c\u7136\u540e\u6309\u56de\u8f66\u8fd0\u884c\u811a\u672c\u3002\u4f8b\u5982\uff1a\n<pre><code class=\"language-bash\">python hello.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u547d\u4ee4\u884c\u4f1a\u663e\u793a\u811a\u672c\u7684\u8f93\u51fa\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u914d\u7f6ePython\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5c24\u5176\u662f\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u624b\u52a8\u914d\u7f6ePython\u7684\u73af\u5883\u53d8\u91cf\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528<code>python<\/code>\u547d\u4ee4\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5\u73af\u5883\u53d8\u91cf<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u68c0\u67e5\u662f\u5426\u80fd\u8bc6\u522bPython\u547d\u4ee4\u3002<\/li>\n<li>\u5982\u679c\u663e\u793a\u201ccommand not found\u201d\u6216\u7c7b\u4f3c\u9519\u8bef\uff0c\u8bf4\u660e\u9700\u8981\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u63a7\u5236\u9762\u677f\u201d\uff0c\u9009\u62e9\u201c\u7cfb\u7edf\u548c\u5b89\u5168\u201d&gt;\u201c\u7cfb\u7edf\u201d\uff0c\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\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>\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u8f93\u5165Python\u5b89\u88c5\u76ee\u5f55\u7684\u8def\u5f84\uff08\u901a\u5e38\u662f<code>C:\\Python39<\/code>\u6216\u7c7b\u4f3c\u8def\u5f84\uff09\uff0c\u7136\u540e\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u3002<\/li>\n<li>\u91cd\u65b0\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python --version<\/code>\u68c0\u67e5\u914d\u7f6e\u662f\u5426\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5904\u7406\u5e38\u89c1\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u5728\u8fd0\u884cPython\u811a\u672c\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u7248\u672c\u95ee\u9898<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u6709\u65f6\u7cfb\u7edf\u4e0a\u53ef\u80fd\u5b89\u88c5\u4e86\u591a\u4e2aPython\u7248\u672c\uff0c\u4f7f\u7528<code>python<\/code>\u547d\u4ee4\u53ef\u80fd\u4f1a\u9ed8\u8ba4\u8c03\u7528\u65e7\u7248\u672c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u6765\u6307\u5b9a\u4f7f\u7528Python 3\u3002<\/li>\n<li>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u522b\u540d\u6216\u4fee\u6539\u73af\u5883\u53d8\u91cf\u8def\u5f84\u7684\u987a\u5e8f\u6765\u89e3\u51b3\u7248\u672c\u51b2\u7a81\u95ee\u9898\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6a21\u5757\u5bfc\u5165\u9519\u8bef<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u4f60\u7684\u811a\u672c\u4e2d\u4f7f\u7528\u4e86\u5916\u90e8\u5e93\uff08\u5982NumPy\u3001Pandas\u7b49\uff09\uff0c\u9700\u8981\u786e\u4fdd\u8fd9\u4e9b\u5e93\u5df2\u7ecf\u5b89\u88c5\u3002\u53ef\u4ee5\u4f7f\u7528<code>pip install library_name<\/code>\u547d\u4ee4\u6765\u5b89\u88c5\u6240\u9700\u5e93\u3002<\/li>\n<li>\u5982\u679c\u4ecd\u7136\u51fa\u73b0\u6a21\u5757\u5bfc\u5165\u9519\u8bef\uff0c\u68c0\u67e5Python\u89e3\u91ca\u5668\u7684\u7248\u672c\u548c\u5b89\u88c5\u8def\u5f84\uff0c\u786e\u4fddpip\u548cPython\u6307\u5411\u76f8\u540c\u7684\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884cPython\u811a\u672c\u53ef\u80fd\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u3002\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u5728Linux\u6216macOS\u4e0a\uff0c\u4f7f\u7528<code>sudo<\/code>\u547d\u4ee4\u63d0\u5347\u6743\u9650\uff08\u5c0f\u5fc3\u4f7f\u7528sudo\uff0c\u786e\u4fdd\u77e5\u9053\u81ea\u5df1\u5728\u505a\u4ec0\u4e48\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u7ba1\u7406\u4f9d\u8d56<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u590d\u6742\u9879\u76ee\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528Python\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u3002\u8fd9\u6709\u52a9\u4e8e\u9694\u79bb\u9879\u76ee\u73af\u5883\uff0c\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u4f8b\u5982\uff0c\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u8fd0\u884c\uff1a\n<pre><code class=\"language-bash\">python -m venv env<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>env<\/code>\u7684\u865a\u62df\u73af\u5883\u6587\u4ef6\u5939\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u4e0a\uff0c\u4f7f\u7528\u547d\u4ee4\uff1a<code>.\\env\\Scripts\\activate<\/code>\u3002<\/li>\n<li>\u5728macOS\/Linux\u4e0a\uff0c\u4f7f\u7528\u547d\u4ee4\uff1a<code>source env\/bin\/activate<\/code>\u3002<\/li>\n<li>\u6fc0\u6d3b\u540e\uff0c\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u4f1a\u51fa\u73b0\u865a\u62df\u73af\u5883\u540d\u79f0\uff0c\u8868\u793a\u5df2\u7ecf\u8fdb\u5165\u865a\u62df\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u6765\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u3002\u4f8b\u5982\uff1a\n<pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6240\u6709\u5b89\u88c5\u7684\u5e93\u5c06\u4fdd\u5b58\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u7684\u5168\u5c40Python\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9000\u51fa\u865a\u62df\u73af\u5883<\/strong>  <\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u547d\u4ee4<code>deactivate<\/code>\u9000\u51fa\u865a\u62df\u73af\u5883\uff0c\u8fd4\u56de\u5230\u5168\u5c40Python\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u5728\u672c\u5730\u6210\u529f\u8fd0\u884cPython\u811a\u672c\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u811a\u672c\u8fd8\u662f\u590d\u6742\u7684\u9879\u76ee\uff0c\u7406\u89e3\u5982\u4f55\u914d\u7f6e\u548c\u7ba1\u7406Python\u73af\u5883\u90fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u6280\u80fd\u3002\u968f\u7740\u5bf9Python\u7684\u6df1\u5165\u5b66\u4e60\uff0c\u4f60\u4f1a\u53d1\u73b0\u5176\u5f3a\u5927\u7684\u529f\u80fd\u548c\u5e7f\u6cdb\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u672c\u5730\u73af\u5883\u4e2d\u5b89\u88c5Python\uff1f<\/strong><br \/>\u8981\u5728\u672c\u5730\u8fd0\u884cPython\u811a\u672c\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\u3002\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u6700\u65b0\u7248\u672c\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u8bf7\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u8f7b\u677e\u8bbf\u95eePython\u3002<\/p>\n<p><strong>\u5728\u672c\u5730\u8fd0\u884cPython\u811a\u672c\u9700\u8981\u54ea\u4e9b\u5de5\u5177\u6216\u8f6f\u4ef6\uff1f<\/strong><br \/>\u9664\u4e86Python\u81ea\u8eab\uff0c\u60a8\u53ef\u80fd\u8fd8\u9700\u8981\u4e00\u4e2a\u4ee3\u7801\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u5982PyCharm\u3001Visual Studio Code\u6216Jupyter Notebook\u3002\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u63d0\u4f9b\u66f4\u597d\u7684\u4ee3\u7801\u7f16\u5199\u3001\u8c03\u8bd5\u548c\u8fd0\u884c\u4f53\u9a8c\u3002\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5de5\u5177\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u60a8\u7684\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython\u811a\u672c\u7684\u6b65\u9aa4\u5341\u5206\u7b80\u5355\u3002\u9996\u5148\uff0c\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5b58\u653ePython\u811a\u672c\u7684\u76ee\u5f55\u3002\u63a5\u4e0b\u6765\uff0c\u8f93\u5165<code>python script_name.py<\/code>\uff08\u5c06<code>script_name.py<\/code>\u66ff\u6362\u4e3a\u60a8\u7684\u6587\u4ef6\u540d\uff09\u5e76\u6309\u4e0b\u56de\u8f66\u952e\uff0cPython\u89e3\u91ca\u5668\u5c06\u6267\u884c\u8be5\u811a\u672c\u3002\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u4e2d\u540c\u65f6\u5b89\u88c5\u4e86\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u6765\u6307\u5b9a\u7248\u672c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728\u672c\u5730\u8fd0\u884cPython\u811a\u672c\uff0c\u4f60\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u7f16\u5199Python\u811a\u672c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6267\u884c\u811a\u672c\u3002\u9996\u5148\uff0c\u786e [&hellip;]","protected":false},"author":3,"featured_media":955007,"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\/955001"}],"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=955001"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/955001\/revisions"}],"predecessor-version":[{"id":955010,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/955001\/revisions\/955010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/955007"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=955001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=955001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=955001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}