{"id":1055477,"date":"2024-12-31T14:51:01","date_gmt":"2024-12-31T06:51:01","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1055477.html"},"modified":"2024-12-31T14:51:16","modified_gmt":"2024-12-31T06:51:16","slug":"%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8%e8%87%aa%e5%b7%b1%e5%86%99%e7%9a%84python%e7%a8%8b%e5%ba%8f%e5%90%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1055477.html","title":{"rendered":"\u5982\u4f55\u8c03\u7528\u81ea\u5df1\u5199\u7684python\u7a0b\u5e8f\u5417"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/18d82932-341a-4554-83d0-bccbda92750a.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u8c03\u7528\u81ea\u5df1\u5199\u7684python\u7a0b\u5e8f\u5417\" \/><\/p>\n<p><p> <strong>\u8c03\u7528\u81ea\u5df1\u5199\u7684Python\u7a0b\u5e8f\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u76f4\u63a5\u5728\u7ec8\u7aef\u8fd0\u884c\u3001\u901a\u8fc7\u811a\u672c\u8c03\u7528\u3001\u4f7f\u7528\u6a21\u5757\u5bfc\u5165\u3001\u901a\u8fc7Web\u63a5\u53e3\u8c03\u7528\u7b49\u3002<\/strong>\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u63d0\u4f9b\u5177\u4f53\u7684\u6b65\u9aa4\u548c\u793a\u4f8b\u4ee3\u7801\uff0c\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u6280\u5de7\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u8ba8\u8bba\u5176\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\u2014\u2014\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u51c6\u5907Python\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u7f16\u5199\u4f60\u7684Python\u811a\u672c\u5e76\u4fdd\u5b58\u4e3a\u4e00\u4e2a<code>.py<\/code>\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a<code>example.py<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># example.py<\/p>\n<p>def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    print(&quot;Hello, World!&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u811a\u672c\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u51fd\u6570<code>main<\/code>\uff0c\u5e76\u5728\u811a\u672c\u4f5c\u4e3a\u4e3b\u7a0b\u5e8f\u8fd0\u884c\u65f6\u8c03\u7528\u8be5\u51fd\u6570\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00\u7ec8\u7aef<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684\u7ec8\u7aef\u3002\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08Command Prompt\uff09\u6216PowerShell\uff1b\u5bf9\u4e8eMac\u548cLinux\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff08Terminal\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5305\u542b\u4f60\u7684Python\u811a\u672c\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u811a\u672c\u4f4d\u4e8e\u684c\u9762\u4e0a\u7684\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">cd Desktop\/your-folder<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\u8fd0\u884c\u4f60\u7684\u811a\u672c\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u7684Python\u5b89\u88c5\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u6307\u5b9a\u7248\u672c\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3 example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u4f60\u5e94\u8be5\u4f1a\u5728\u7ec8\u7aef\u4e2d\u770b\u5230\u201cHello, World!\u201d\u7684\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u901a\u8fc7\u811a\u672c\u8c03\u7528Python\u7a0b\u5e8f<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u5199\u4e3b\u8c03\u7528\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u4e3b\u811a\u672c\u6765\u8c03\u7528\u5176\u4ed6Python\u811a\u672c\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>main.py<\/code>\u7684\u811a\u672c\uff0c\u5b83\u5c06\u8c03\u7528\u4e4b\u524d\u7684<code>example.py<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>def run_example_script():<\/p>\n<p>    result = subprocess.run([&#39;python&#39;, &#39;example.py&#39;], capture_output=True, text=True)<\/p>\n<p>    print(result.stdout)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    run_example_script()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u6765\u8fd0\u884c<code>example.py<\/code>\u811a\u672c\uff0c\u5e76\u6355\u83b7\u5176\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4e3b\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4e0e\u4e4b\u524d\u7684\u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4f60\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c<code>main.py<\/code>\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python main.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u4f60\u5e94\u8be5\u4f1a\u5728\u7ec8\u7aef\u4e2d\u770b\u5230\u201cHello, World!\u201d\u7684\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u6a21\u5757\u5bfc\u5165<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5c06\u811a\u672c\u8f6c\u6362\u4e3a\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u5c06\u4f60\u7684Python\u811a\u672c\u8f6c\u6362\u4e3a\u6a21\u5757\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4ed6\u811a\u672c\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u5b83\u3002\u4f8b\u5982\uff0c\u5c06<code>example.py<\/code>\u4fee\u6539\u4e3a\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># example.py<\/p>\n<p>def main():<\/p>\n<p>    print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728\u4e3b\u811a\u672c\u4e2d\u5bfc\u5165\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>main.py<\/code>\u7684\u811a\u672c\uff0c\u5e76\u5728\u5176\u4e2d\u5bfc\u5165<code>example<\/code>\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import example<\/p>\n<p>def run_example_script():<\/p>\n<p>    example.main()<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    run_example_script()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4e3b\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4e0e\u4e4b\u524d\u7684\u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4f60\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c<code>main.py<\/code>\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python main.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u4f60\u5e94\u8be5\u4f1a\u5728\u7ec8\u7aef\u4e2d\u770b\u5230\u201cHello, World!\u201d\u7684\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u901a\u8fc7Web\u63a5\u53e3\u8c03\u7528Python\u7a0b\u5e8f<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Flask\u5e94\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528Flask\u6846\u67b6\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Web\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u901a\u8fc7HTTP\u8bf7\u6c42\u6765\u8c03\u7528Python\u51fd\u6570\u3002\u9996\u5148\uff0c\u5b89\u88c5Flask\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install flask<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>app.py<\/code>\u7684\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, jsonify<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/run-script&#39;)<\/p>\n<p>def run_script():<\/p>\n<p>    return jsonify(message=&quot;Hello, World!&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    app.run(debug=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cFlask\u5e94\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cFlask\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python app.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f60\u7684Flask\u5e94\u7528\u5c06\u8fd0\u884c\u5728<code>http:\/\/127.0.0.1:5000\/<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u901a\u8fc7Web\u6d4f\u89c8\u5668\u6216HTTP\u5ba2\u6237\u7aef\u8bbf\u95ee<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00Web\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee<code>http:\/\/127.0.0.1:5000\/run-script<\/code>\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230JSON\u54cd\u5e94\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-json\">{<\/p>\n<p>    &quot;message&quot;: &quot;Hello, World!&quot;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528HTTP\u5ba2\u6237\u7aef\uff08\u5982Postman\u6216cURL\uff09\u6765\u8bbf\u95ee\u8be5URL\u5e76\u67e5\u770b\u54cd\u5e94\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u4f7f\u7528\u8c03\u5ea6\u7a0b\u5e8f\u81ea\u52a8\u8fd0\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528cron\uff08Linux\/Mac\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528cron\u8c03\u5ea6\u7a0b\u5e8f\u5728\u7279\u5b9a\u65f6\u95f4\u81ea\u52a8\u8fd0\u884cPython\u811a\u672c\u3002\u9996\u5148\uff0c\u6253\u5f00crontab\u7f16\u8f91\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">crontab -e<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\u4ee5\u6bcf\u5929\u51cc\u66681\u70b9\u8fd0\u884c<code>example.py<\/code>\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">0 1 * * * \/usr\/bin\/python3 \/path\/to\/your\/example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Task Scheduler\uff08Windows\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\uff08Task Scheduler\uff09\u6765\u81ea\u52a8\u8fd0\u884cPython\u811a\u672c\u3002\u6253\u5f00\u4efb\u52a1\u8ba1\u5212\u7a0b\u5e8f\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u57fa\u672c\u4efb\u52a1\uff0c\u5e76\u6309\u7167\u5411\u5bfc\u6b65\u9aa4\u8bbe\u7f6e\u4efb\u52a1\u7684\u89e6\u53d1\u5668\u548c\u64cd\u4f5c\u3002\u5728\u64cd\u4f5c\u90e8\u5206\uff0c\u9009\u62e9\u201c\u542f\u52a8\u7a0b\u5e8f\u201d\uff0c\u5e76\u6307\u5b9aPython\u89e3\u91ca\u5668\u548c\u811a\u672c\u7684\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884c\u3001\u901a\u8fc7\u811a\u672c\u8c03\u7528\u3001\u4f7f\u7528\u6a21\u5757\u5bfc\u5165\u3001\u901a\u8fc7Web\u63a5\u53e3\u8c03\u7528\u3001\u4f7f\u7528\u8c03\u5ea6\u7a0b\u5e8f\u81ea\u52a8\u8fd0\u884c\u662f\u8c03\u7528\u81ea\u5df1\u5199\u7684Python\u7a0b\u5e8f\u7684\u51e0\u79cd\u5e38\u89c1\u65b9\u6cd5\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u5e0c\u671b\u672c\u6587\u7684\u8be6\u7ec6\u6b65\u9aa4\u548c\u793a\u4f8b\u4ee3\u7801\u80fd\u591f\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u6280\u5de7\u3002\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u9700\u8981\u8fdb\u4e00\u6b65\u7684\u5e2e\u52a9\uff0c\u8bf7\u968f\u65f6\u7559\u8a00\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\u884c\u6211\u7684Python\u7a0b\u5e8f\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762\uff0c\u5bfc\u822a\u5230\u5305\u542b\u60a8Python\u7a0b\u5e8f\u7684\u76ee\u5f55\uff0c\u5e76\u4f7f\u7528\u547d\u4ee4<code>python your_script.py<\/code>\u6765\u8fd0\u884c\u60a8\u7684\u7a0b\u5e8f\u3002\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3 your_script.py<\/code>\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u7684Python\u5b89\u88c5\u3002<\/p>\n<p><strong>\u6211\u53ef\u4ee5\u5728\u7f51\u9875\u4e0a\u8c03\u7528\u6211\u7684Python\u7a0b\u5e8f\u5417\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Flask\u6216Django\u7b49\u6846\u67b6\u5c06\u60a8\u7684Python\u7a0b\u5e8f\u6258\u7ba1\u4e3aWeb\u5e94\u7528\u7a0b\u5e8f\u3002\u901a\u8fc7\u8bbe\u7f6e\u8def\u7531\uff0c\u60a8\u80fd\u591f\u8ba9\u7528\u6237\u901a\u8fc7\u7f51\u9875\u754c\u9762\u8f93\u5165\u6570\u636e\u5e76\u8c03\u7528\u60a8\u7684\u7a0b\u5e8f\uff0c\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u5176\u4ed6Python\u811a\u672c\u4e2d\u8c03\u7528\u6211\u7684Python\u7a0b\u5e8f\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u5c06\u60a8\u7684Python\u7a0b\u5e8f\u4f5c\u4e3a\u6a21\u5757\u5bfc\u5165\u5230\u5176\u4ed6\u811a\u672c\u4e2d\u3002\u5982\u679c\u60a8\u7684\u7a0b\u5e8f\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u60a8\u53ea\u9700\u786e\u4fdd\u8be5\u6587\u4ef6\u5728Python\u8def\u5f84\u4e2d\uff0c\u5e76\u4e14\u4f7f\u7528<code>import your_script<\/code>\u5373\u53ef\u8c03\u7528\u5176\u4e2d\u7684\u51fd\u6570\u548c\u7c7b\u3002<\/p>\n<p><strong>\u6211\u8be5\u5982\u4f55\u8c03\u8bd5\u6211\u7684Python\u7a0b\u5e8f\u4ee5\u786e\u4fdd\u5b83\u6b63\u5e38\u5de5\u4f5c\uff1f<\/strong><br \/>\u8c03\u8bd5\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u8fdb\u884c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>pdb<\/code>\u8c03\u8bd5\u5668\uff0c\u6216\u5229\u7528IDE\uff08\u5982PyCharm\u6216VSCode\uff09\u4e2d\u7684\u8c03\u8bd5\u5de5\u5177\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u63d2\u5165\u6253\u5370\u8bed\u53e5\u6765\u8f93\u51fa\u53d8\u91cf\u503c\uff0c\u5e2e\u52a9\u60a8\u7406\u89e3\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8c03\u7528\u81ea\u5df1\u5199\u7684Python\u7a0b\u5e8f\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u76f4\u63a5\u5728\u7ec8\u7aef\u8fd0\u884c\u3001\u901a\u8fc7\u811a\u672c\u8c03\u7528\u3001\u4f7f\u7528\u6a21\u5757\u5bfc\u5165\u3001\u901a\u8fc7Web\u63a5\u53e3\u8c03\u7528\u7b49 [&hellip;]","protected":false},"author":3,"featured_media":1055501,"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\/1055477"}],"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=1055477"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1055477\/revisions"}],"predecessor-version":[{"id":1055504,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1055477\/revisions\/1055504"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1055501"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1055477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1055477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1055477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}