{"id":929938,"date":"2024-12-26T17:05:50","date_gmt":"2024-12-26T09:05:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/929938.html"},"modified":"2024-12-26T17:05:52","modified_gmt":"2024-12-26T09:05:52","slug":"python-%e5%a6%82%e4%bd%95%e6%89%a7%e8%a1%8c-py","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/929938.html","title":{"rendered":"python \u5982\u4f55\u6267\u884c.py"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25064919\/9b531ceb-9a59-4f1f-88a5-6a1d4d823c2d.webp\" alt=\"python \u5982\u4f55\u6267\u884c.py\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u6267\u884c.py\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ee5\u53ca\u901a\u8fc7\u811a\u672c\u8c03\u7528\u3002\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5bfc\u822a\u5230\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u5e76\u8f93\u5165<code>python filename.py<\/code>\u6765\u6267\u884c\uff1b\u5728IDE\u4e2d\uff0c\u53ea\u9700\u6253\u5f00.py\u6587\u4ef6\u5e76\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\uff1b\u6b64\u5916\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5728Python\u811a\u672c\u4e2d\u4f7f\u7528<code>execfile()<\/code>\uff08Python 2\uff09\u6216<code>exec(open(filename).read())<\/code>\uff08Python 3\uff09\u6765\u6267\u884c\u5176\u4ed6.py\u6587\u4ef6\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u51e0\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u6267\u884c.py\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c.py\u6587\u4ef6\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff0c\u5c24\u5176\u662f\u5728\u5f00\u53d1\u548c\u90e8\u7f72\u9636\u6bb5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbe\u7f6ePython\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6765\u68c0\u67e5Python\u7248\u672c\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5Python\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00\u547d\u4ee4\u884c<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u4e0a\uff0c\u4f60\u53ef\u4ee5\u6309<code>Win + R<\/code>\uff0c\u7136\u540e\u8f93\u5165<code>cmd<\/code>\u6765\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u5728MacOS\u548cLinux\u4e0a\uff0c\u4f60\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5305\u542b.py\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u6587\u4ef6\u4f4d\u4e8e<code>C:\\Users\\YourName\\Documents<\/code>\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd C:\\Users\\YourName\\Documents<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884c\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u6267\u884c.py\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python filename.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e0a\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u800c\u4e0d\u662f<code>python<\/code>\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/p>\n<\/p>\n<p><p>\u8bb8\u591a\u5f00\u53d1\u8005\u4f7f\u7528IDE\u6765\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u56e0\u4e3a\u5b83\u4eec\u63d0\u4f9b\u4e86\u8c03\u8bd5\u548c\u4ee3\u7801\u7ba1\u7406\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u548c\u5b89\u88c5IDE<\/strong><\/p>\n<\/p>\n<p><p>\u6709\u591a\u79cdIDE\u53ef\u4f9b\u9009\u62e9\uff0c\u5982PyCharm\u3001Visual Studio Code\u3001Eclipse\uff08\u914d\u5408PyDev\u63d2\u4ef6\uff09\u7b49\u3002\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4f60\u504f\u597d\u7684IDE\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00\u548c\u8fd0\u884c.py\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u4f60\u7684IDE\u6253\u5f00.py\u6587\u4ef6\u3002\u5927\u591a\u6570IDE\u90fd\u6709\u4e00\u4e2a\u8fd0\u884c\u6309\u94ae\uff08\u901a\u5e38\u662f\u4e00\u4e2a\u7eff\u8272\u7684\u7bad\u5934\uff09\uff0c\u70b9\u51fb\u5b83\u5373\u53ef\u6267\u884c\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u8fd0\u884c\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u914d\u7f6ePython\u89e3\u91ca\u5668\u8def\u5f84\u548c\u9879\u76ee\u8bbe\u7f6e\u3002\u786e\u4fdd\u9009\u62e9\u6b63\u786e\u7684Python\u7248\u672c\u548c\u73af\u5883\uff0c\u4ee5\u907f\u514d\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u5728Python\u811a\u672c\u4e2d\u8c03\u7528\u5176\u4ed6.py\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u811a\u672c\u8c03\u7528\u5176\u4ed6.py\u6587\u4ef6\uff0c\u8fd9\u5bf9\u4e8e\u6a21\u5757\u5316\u7f16\u7a0b\u548c\u4ee3\u7801\u590d\u7528\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528<code>import<\/code>\u8bed\u53e5<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5e0c\u671b\u5728\u4e00\u4e2aPython\u811a\u672c\u4e2d\u4f7f\u7528\u53e6\u4e00\u4e2a.py\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u6216\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u4f60\u6709\u4e00\u4e2a\u540d\u4e3a<code>module.py<\/code>\u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5b9a\u4e49\u4e86\u4e00\u4e2a\u51fd\u6570<code>hello()<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># module.py<\/p>\n<p>def hello():<\/p>\n<p>    print(&quot;Hello from module!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u5728\u53e6\u4e00\u4e2a\u811a\u672c\u4e2d\u5bfc\u5165\u5e76\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n.py<\/p>\n<p>import module<\/p>\n<p>module.hello()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528<code>exec()<\/code>\u51fd\u6570<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 3\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>exec()<\/code>\u51fd\u6570\u6765\u6267\u884c\u4e00\u4e2a\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684Python\u4ee3\u7801\u3002\u8fd9\u5728\u52a8\u6001\u6267\u884c\u4ee3\u7801\u65f6\u975e\u5e38\u6709\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&#39;filename.py&#39;) as file:<\/p>\n<p>    exec(file.read())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u9700\u8981\u52a8\u6001\u52a0\u8f7d\u548c\u6267\u884c\u4ee3\u7801\u7684\u573a\u666f\uff0c\u4f46\u901a\u5e38\u4e0d\u5efa\u8bae\u5728\u5e38\u89c4\u5f00\u53d1\u4e2d\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u5bfc\u81f4\u4ee3\u7801\u96be\u4ee5\u8c03\u8bd5\u548c\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u901a\u8fc7\u4efb\u52a1\u8c03\u5ea6\u5668\u6216\u811a\u672c\u81ea\u52a8\u6267\u884c<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5728\u7279\u5b9a\u65f6\u95f4\u6216\u6761\u4ef6\u4e0b\u81ea\u52a8\u6267\u884c.py\u6587\u4ef6\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u7684\u4efb\u52a1\u8c03\u5ea6\u5668\u6216\u811a\u672c\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows\u4efb\u52a1\u8ba1\u5212<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\u6765\u81ea\u52a8\u6267\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u4efb\u52a1\u3002<\/li>\n<li>\u8bbe\u7f6e\u89e6\u53d1\u5668\u548c\u64cd\u4f5c\uff0c\u5c06Python\u89e3\u91ca\u5668\uff08\u5982<code>python.exe<\/code>\uff09\u4f5c\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5c06.py\u6587\u4ef6\u7684\u8def\u5f84\u4f5c\u4e3a\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Unix\/Linux\u4e0a\u7684Cron\u4f5c\u4e1a<\/strong><\/p>\n<\/p>\n<p><p>\u5728Unix\u6216Linux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528Cron\u4f5c\u4e1a\u6765\u5b9a\u671f\u6267\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528<code>crontab -e<\/code>\u547d\u4ee4\u7f16\u8f91Cron\u4f5c\u4e1a\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6dfb\u52a0\u4e00\u884c\u4ee5\u6307\u5b9a\u6267\u884c\u9891\u7387\u548c\u811a\u672c\u8def\u5f84\uff0c\u4f8b\u5982\uff0c\u6bcf\u5929\u5348\u591c\u6267\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">0 0 * * * \/usr\/bin\/python3 \/path\/to\/your\/script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u811a\u672c\u81ea\u52a8\u5316<\/strong><\/p>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2aShell\u811a\u672c\u6216\u6279\u5904\u7406\u6587\u4ef6\u6765\u81ea\u52a8\u6267\u884cPython\u811a\u672c\u3002\u5bf9\u4e8eShell\u811a\u672c\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">#!\/bin\/bash<\/p>\n<p>\/usr\/bin\/python3 \/path\/to\/your\/script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5bf9\u4e8eWindows\u6279\u5904\u7406\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-batch\">@echo off<\/p>\n<p>python C:\\path\\to\\your\\script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u8fdc\u7a0b\u6267\u884cPython\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u6267\u884cPython\u811a\u672c\uff0c\u8fd9\u901a\u5e38\u6d89\u53ca\u5230SSH\u548c\u8fdc\u7a0b\u7ba1\u7406\u5de5\u5177\u7684\u4f7f\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528SSH\u8fde\u63a5<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u6709\u8fdc\u7a0b\u670d\u52a1\u5668\u7684SSH\u8bbf\u95ee\u6743\u9650\uff0c\u53ef\u4ee5\u4f7f\u7528SSH\u8fde\u63a5\u5e76\u6267\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">ssh user@remote-server &#39;python3 \/path\/to\/script.py&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u8fdc\u7a0b\u7ba1\u7406\u5de5\u5177<\/strong><\/p>\n<\/p>\n<p><p>\u5de5\u5177\u5982Ansible\u3001Fabric\u7b49\u53ef\u4ee5\u5e2e\u52a9\u4f60\u81ea\u52a8\u5316\u548c\u7ba1\u7406\u8fdc\u7a0b\u811a\u672c\u6267\u884c\u3002\u4ee5Fabric\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5b89\u88c5Fabric\uff1a<code>pip install fabric<\/code><\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u7f16\u5199\u4e00\u4e2aFabric\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from fabric import Connection<\/p>\n<p>def deploy():<\/p>\n<p>    with Connection(&#39;user@remote-server&#39;) as c:<\/p>\n<p>        c.run(&#39;python3 \/path\/to\/script.py&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528Fabric\u547d\u4ee4\u6267\u884c\uff1a<code>fab deploy<\/code><\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u4f60\u53ef\u4ee5\u5728\u4e0d\u540c\u73af\u5883\u4e0b\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u6765\u6267\u884cPython\u811a\u672c\uff0c\u63d0\u9ad8\u5f00\u53d1\u548c\u8fd0\u7ef4\u6548\u7387\u3002\u65e0\u8bba\u662f\u672c\u5730\u5f00\u53d1\u3001\u8fdc\u7a0b\u6267\u884c\u8fd8\u662f\u81ea\u52a8\u5316\u8c03\u5ea6\uff0c\u90fd\u6709\u76f8\u5e94\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cPython .py\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4e00\u4e2aPython .py\u6587\u4ef6\uff0c\u60a8\u9700\u8981\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u5bfc\u822a\u5230\u5305\u542b\u8be5\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u63a5\u7740\uff0c\u8f93\u5165\u547d\u4ee4 <code>python filename.py<\/code> \u6216\u8005 <code>python3 filename.py<\/code>\uff08\u53d6\u51b3\u4e8e\u60a8\u7684Python\u7248\u672c\uff09\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u5373\u53ef\u8fd0\u884c\u8be5\u6587\u4ef6\u3002<\/p>\n<p><strong>\u6211\u9700\u8981\u5b89\u88c5Python\u5417\uff1f\u5982\u679c\u9700\u8981\uff0c\u5982\u4f55\u5b89\u88c5\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u8fd0\u884c.py\u6587\u4ef6\u9700\u8981\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u3002\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\uff0c\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff0c\u5e76\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u7684\u6b65\u9aa4\u5b8c\u6210\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165 <code>python --version<\/code> \u6216 <code>python3 --version<\/code> \u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728IDE\u4e2d\u6267\u884cPython .py\u6587\u4ef6\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u66f4\u559c\u6b22\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u8fd0\u884cPython\u7a0b\u5e8f\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u50cfPyCharm\u3001Visual Studio Code\u6216Jupyter Notebook\u7b49\u5de5\u5177\u3002\u5728\u8fd9\u4e9bIDE\u4e2d\uff0c\u6253\u5f00\u60a8\u7684.py\u6587\u4ef6\uff0c\u901a\u5e38\u4f1a\u6709\u4e00\u4e2a\u201c\u8fd0\u884c\u201d\u6309\u94ae\u6216\u5feb\u6377\u952e\uff08\u4f8b\u5982F5\uff09\uff0c\u70b9\u51fb\u540e\u5373\u53ef\u6267\u884c\u4ee3\u7801\u5e76\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u5f0f\u901a\u5e38\u63d0\u4f9b\u66f4\u53cb\u597d\u7684\u8c03\u8bd5\u548c\u9519\u8bef\u63d0\u793a\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u6267\u884c.py\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ee5\u53ca\u901a\u8fc7\u811a\u672c\u8c03\u7528\u3002\u5728\u547d\u4ee4\u884c\u4e2d\uff0c [&hellip;]","protected":false},"author":3,"featured_media":929941,"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\/929938"}],"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=929938"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/929938\/revisions"}],"predecessor-version":[{"id":929945,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/929938\/revisions\/929945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/929941"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=929938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=929938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=929938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}