{"id":1119167,"date":"2025-01-08T18:42:11","date_gmt":"2025-01-08T10:42:11","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1119167.html"},"modified":"2025-01-08T18:42:13","modified_gmt":"2025-01-08T10:42:13","slug":"python%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e4%b8%a4%e4%b8%aa%e5%87%bd%e6%95%b0%e7%9a%84%e8%b0%83%e7%94%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1119167.html","title":{"rendered":"python\u5982\u4f55\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u7684\u8c03\u7528"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082400\/d0ff2073-9dff-4759-a8df-fd394e47a9c5.webp\" alt=\"python\u5982\u4f55\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u7684\u8c03\u7528\" \/><\/p>\n<p><p> <strong>Python\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u7684\u8c03\u7528<\/strong>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u76f4\u63a5\u8c03\u7528\u3001\u5d4c\u5957\u8c03\u7528\u3001\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c\u7b49\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u63d0\u4f9b\u76f8\u5173\u793a\u4f8b\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u76f4\u63a5\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6700\u7b80\u5355\u7684\u51fd\u6570\u8c03\u7528\u65b9\u5f0f\u662f\u76f4\u63a5\u8c03\u7528\u3002\u76f4\u63a5\u8c03\u7528\u662f\u6307\u5728\u4e00\u4e2a\u51fd\u6570\u4e2d\u76f4\u63a5\u8c03\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u7684\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def func1():<\/p>\n<p>    print(&quot;This is function 1&quot;)<\/p>\n<p>def func2():<\/p>\n<p>    print(&quot;This is function 2&quot;)<\/p>\n<p>    func1()  # \u76f4\u63a5\u8c03\u7528func1<\/p>\n<p>func2()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>func2<\/code>\u51fd\u6570\u4e2d\u76f4\u63a5\u8c03\u7528\u4e86<code>func1<\/code>\u51fd\u6570\u3002\u5f53\u6267\u884c<code>func2<\/code>\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u6253\u5370&quot;This is function 2&quot;\uff0c\u7136\u540e\u8c03\u7528<code>func1<\/code>\u51fd\u6570\uff0c\u6253\u5370&quot;This is function 1&quot;\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5d4c\u5957\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u5d4c\u5957\u8c03\u7528\u662f\u6307\u5728\u4e00\u4e2a\u51fd\u6570\u4e2d\u5d4c\u5957\u8c03\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u51fd\u6570\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def func1():<\/p>\n<p>    print(&quot;This is function 1&quot;)<\/p>\n<p>def func2():<\/p>\n<p>    def func3():<\/p>\n<p>        print(&quot;This is function 3&quot;)<\/p>\n<p>        func1()  # \u5d4c\u5957\u8c03\u7528func1<\/p>\n<p>    func3()<\/p>\n<p>    print(&quot;This is function 2&quot;)<\/p>\n<p>func2()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>func3<\/code>\u51fd\u6570\u5d4c\u5957\u5728<code>func2<\/code>\u51fd\u6570\u4e2d\u3002\u5728<code>func3<\/code>\u51fd\u6570\u4e2d\u8c03\u7528\u4e86<code>func1<\/code>\u51fd\u6570\u3002\u5f53\u6267\u884c<code>func2<\/code>\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u8c03\u7528<code>func3<\/code>\u51fd\u6570\uff0c\u6253\u5370&quot;This is function 3&quot;\uff0c\u7136\u540e\u8c03\u7528<code>func1<\/code>\u51fd\u6570\uff0c\u6253\u5370&quot;This is function 1&quot;\uff0c\u6700\u540e\u6253\u5370&quot;This is function 2&quot;\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012<\/p>\n<\/p>\n<p><p>Python\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u51fd\u6570\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def func1():<\/p>\n<p>    print(&quot;This is function 1&quot;)<\/p>\n<p>def func2(func):<\/p>\n<p>    print(&quot;This is function 2&quot;)<\/p>\n<p>    func()  # \u8c03\u7528\u4f20\u9012\u7684\u51fd\u6570<\/p>\n<p>func2(func1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>func2<\/code>\u51fd\u6570\u63a5\u53d7\u4e00\u4e2a\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u3002\u5728\u8c03\u7528<code>func2<\/code>\u51fd\u6570\u65f6\uff0c\u5c06<code>func1<\/code>\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9<code>func2<\/code>\u51fd\u6570\u3002\u5728<code>func2<\/code>\u51fd\u6570\u4e2d\uff0c\u901a\u8fc7\u8c03\u7528\u4f20\u9012\u7684\u51fd\u6570\u6765\u5b9e\u73b0\u51fd\u6570\u7684\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c<\/p>\n<\/p>\n<p><p>Python\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u53e6\u4e00\u4e2a\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u51fd\u6570\u7684\u94fe\u5f0f\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def func1():<\/p>\n<p>    print(&quot;This is function 1&quot;)<\/p>\n<p>def func2():<\/p>\n<p>    print(&quot;This is function 2&quot;)<\/p>\n<p>    return func1  # \u8fd4\u56defunc1\u51fd\u6570<\/p>\n<p>returned_func = func2()<\/p>\n<p>returned_func()  # \u8c03\u7528\u8fd4\u56de\u7684\u51fd\u6570<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>func2<\/code>\u51fd\u6570\u8fd4\u56de<code>func1<\/code>\u51fd\u6570\u3002\u5f53\u6267\u884c<code>func2<\/code>\u51fd\u6570\u65f6\uff0c\u4f1a\u6253\u5370&quot;This is function 2&quot;\uff0c\u5e76\u8fd4\u56de<code>func1<\/code>\u51fd\u6570\u3002\u7136\u540e\uff0c\u901a\u8fc7\u8c03\u7528\u8fd4\u56de\u7684<code>func1<\/code>\u51fd\u6570\uff0c\u5b9e\u73b0\u51fd\u6570\u7684\u94fe\u5f0f\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u88c5\u9970\u5668\u5b9e\u73b0\u51fd\u6570\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u88c5\u9970\u5668\u662fPython\u4e2d\u7684\u4e00\u79cd\u7279\u6b8a\u51fd\u6570\uff0c\u7528\u4e8e\u5728\u4e0d\u6539\u53d8\u539f\u51fd\u6570\u7684\u60c5\u51b5\u4e0b\uff0c\u6269\u5c55\u5176\u529f\u80fd\u3002\u901a\u8fc7\u88c5\u9970\u5668\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u51fd\u6570\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def func1():<\/p>\n<p>    print(&quot;This is function 1&quot;)<\/p>\n<p>def decorator(func):<\/p>\n<p>    def wrapper():<\/p>\n<p>        print(&quot;This is the decorator&quot;)<\/p>\n<p>        func()  # \u8c03\u7528\u88ab\u88c5\u9970\u7684\u51fd\u6570<\/p>\n<p>    return wrapper<\/p>\n<p>@decorator<\/p>\n<p>def func2():<\/p>\n<p>    print(&quot;This is function 2&quot;)<\/p>\n<p>func2()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>decorator<\/code>\u51fd\u6570\u662f\u4e00\u4e2a\u88c5\u9970\u5668\uff0c\u5b83\u63a5\u53d7\u4e00\u4e2a\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u88c5\u51fd\u6570\u3002\u5728\u5305\u88c5\u51fd\u6570\u4e2d\uff0c\u9996\u5148\u6253\u5370&quot;This is the decorator&quot;\uff0c\u7136\u540e\u8c03\u7528\u88ab\u88c5\u9970\u7684\u51fd\u6570\u3002\u901a\u8fc7\u4f7f\u7528<code>@decorator<\/code>\u8bed\u6cd5\uff0c\u5c06<code>func2<\/code>\u51fd\u6570\u88c5\u9970\u4e3a<code>decorator<\/code>\u51fd\u6570\u3002\u5f53\u6267\u884c<code>func2<\/code>\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u6253\u5370&quot;This is the decorator&quot;\uff0c\u7136\u540e\u8c03\u7528<code>func2<\/code>\u51fd\u6570\uff0c\u6253\u5370&quot;This is function 2&quot;\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u7c7b\u65b9\u6cd5\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7c7b\u65b9\u6cd5\u5b9e\u73b0\u51fd\u6570\u7684\u8c03\u7528\u3002\u7c7b\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u7c7b\u4e2d\u7684\u5176\u4ed6\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def func1(self):<\/p>\n<p>        print(&quot;This is function 1&quot;)<\/p>\n<p>    def func2(self):<\/p>\n<p>        print(&quot;This is function 2&quot;)<\/p>\n<p>        self.func1()  # \u8c03\u7528\u7c7b\u4e2d\u7684func1\u65b9\u6cd5<\/p>\n<p>obj = MyClass()<\/p>\n<p>obj.func2()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>MyClass<\/code>\u7c7b\u4e2d\u5b9a\u4e49\u4e86\u4e24\u4e2a\u65b9\u6cd5<code>func1<\/code>\u548c<code>func2<\/code>\u3002\u5728<code>func2<\/code>\u65b9\u6cd5\u4e2d\uff0c\u901a\u8fc7<code>self<\/code>\u5173\u952e\u5b57\u8c03\u7528\u4e86<code>func1<\/code>\u65b9\u6cd5\u3002\u5f53\u521b\u5efa<code>MyClass<\/code>\u7c7b\u7684\u5b9e\u4f8b\u5e76\u8c03\u7528<code>func2<\/code>\u65b9\u6cd5\u65f6\uff0c\u4f1a\u9996\u5148\u6253\u5370&quot;This is function 2&quot;\uff0c\u7136\u540e\u8c03\u7528<code>func1<\/code>\u65b9\u6cd5\uff0c\u6253\u5370&quot;This is function 1&quot;\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u9012\u5f52\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u9012\u5f52\u8c03\u7528\u662f\u6307\u51fd\u6570\u5728\u5176\u5b9a\u4e49\u4e2d\u8c03\u7528\u81ea\u8eab\u3002\u901a\u8fc7\u9012\u5f52\u8c03\u7528\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e9b\u590d\u6742\u7684\u7b97\u6cd5\uff0c\u5982\u6590\u6ce2\u90a3\u5951\u6570\u5217\u3001\u9636\u4e58\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def factorial(n):<\/p>\n<p>    if n == 1:<\/p>\n<p>        return 1<\/p>\n<p>    else:<\/p>\n<p>        return n * factorial(n - 1)  # \u9012\u5f52\u8c03\u7528\u81ea\u8eab<\/p>\n<p>print(factorial(5))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>factorial<\/code>\u51fd\u6570\u662f\u4e00\u4e2a\u9012\u5f52\u51fd\u6570\uff0c\u7528\u4e8e\u8ba1\u7b97\u9636\u4e58\u3002\u5f53<code>n<\/code>\u7b49\u4e8e1\u65f6\uff0c\u8fd4\u56de1\uff1b\u5426\u5219\uff0c\u8fd4\u56de<code>n<\/code>\u4e58\u4ee5<code>factorial(n - 1)<\/code>\u3002\u901a\u8fc7\u9012\u5f52\u8c03\u7528\u81ea\u8eab\uff0c\u5b9e\u73b0\u4e86\u9636\u4e58\u7684\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u516b\u3001\u751f\u6210\u5668\u51fd\u6570\u8c03\u7528<\/p>\n<\/p>\n<p><p>\u751f\u6210\u5668\u51fd\u6570\u662fPython\u4e2d\u7684\u4e00\u79cd\u7279\u6b8a\u51fd\u6570\uff0c\u901a\u8fc7<code>yield<\/code>\u5173\u952e\u5b57\u8fd4\u56de\u4e00\u4e2a\u751f\u6210\u5668\u5bf9\u8c61\u3002\u751f\u6210\u5668\u5bf9\u8c61\u53ef\u4ee5\u7528\u4e8e\u8fed\u4ee3\uff0c\u5e76\u5728\u6bcf\u6b21\u8fed\u4ee3\u65f6\u751f\u6210\u4e00\u4e2a\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def generator_func():<\/p>\n<p>    yield &quot;This is function 1&quot;<\/p>\n<p>    yield &quot;This is function 2&quot;<\/p>\n<p>gen = generator_func()<\/p>\n<p>for value in gen:<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>generator_func<\/code>\u662f\u4e00\u4e2a\u751f\u6210\u5668\u51fd\u6570\uff0c\u901a\u8fc7<code>yield<\/code>\u5173\u952e\u5b57\u8fd4\u56de\u4e24\u4e2a\u503c\u3002\u5f53\u8c03\u7528<code>generator_func<\/code>\u51fd\u6570\u65f6\uff0c\u8fd4\u56de\u4e00\u4e2a\u751f\u6210\u5668\u5bf9\u8c61\u3002\u901a\u8fc7\u8fed\u4ee3\u751f\u6210\u5668\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f9d\u6b21\u83b7\u53d6\u751f\u6210\u5668\u51fd\u6570\u8fd4\u56de\u7684\u503c\uff0c\u5e76\u6253\u5370&quot;This is function 1&quot;\u548c&quot;This is function 2&quot;\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86Python\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u8c03\u7528\u7684\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u76f4\u63a5\u8c03\u7528\u3001\u5d4c\u5957\u8c03\u7528\u3001\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c\u3001\u88c5\u9970\u5668\u5b9e\u73b0\u51fd\u6570\u8c03\u7528\u3001\u7c7b\u65b9\u6cd5\u8c03\u7528\u3001\u9012\u5f52\u8c03\u7528\u548c\u751f\u6210\u5668\u51fd\u6570\u8c03\u7528\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u5177\u6709\u5176\u72ec\u7279\u7684\u7279\u70b9\u548c\u5e94\u7528\u573a\u666f\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5b9e\u73b0\u65b9\u5f0f\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u66f4\u7075\u6d3b\u5730\u5b9e\u73b0\u51fd\u6570\u7684\u8c03\u7528\u548c\u7ec4\u5408\uff0c\u7f16\u5199\u51fa\u66f4\u52a0\u9ad8\u6548\u548c\u4f18\u96c5\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u51fd\u6570\u4e4b\u95f4\u7684\u8c03\u7528\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u51fd\u6570\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u8c03\u7528\u5176\u4ed6\u51fd\u6570\u6765\u5b9e\u73b0\u76f8\u4e92\u4e4b\u95f4\u7684\u8c03\u7528\u3002\u53ea\u9700\u5728\u4e00\u4e2a\u51fd\u6570\u7684\u5185\u90e8\u4f7f\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\u7684\u540d\u79f0\u5e76\u4f20\u9012\u6240\u9700\u7684\u53c2\u6570\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u6765\u8ba1\u7b97\u5e73\u65b9\uff0c\u518d\u5b9a\u4e49\u53e6\u4e00\u4e2a\u51fd\u6570\u6765\u8ba1\u7b97\u7acb\u65b9\uff0c\u5e76\u5728\u7acb\u65b9\u7684\u51fd\u6570\u4e2d\u8c03\u7528\u5e73\u65b9\u7684\u51fd\u6570\u3002<\/p>\n<p><strong>\u5728\u51fd\u6570\u8c03\u7528\u4e2d\u5982\u4f55\u4f20\u9012\u53c2\u6570\uff1f<\/strong><br \/>\u53c2\u6570\u4f20\u9012\u662f\u51fd\u6570\u8c03\u7528\u4e2d\u7684\u91cd\u8981\u90e8\u5206\u3002\u5728\u5b9a\u4e49\u51fd\u6570\u65f6\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u53c2\u6570\uff0c\u5728\u8c03\u7528\u65f6\u5c06\u5b9e\u9645\u503c\u4f20\u9012\u7ed9\u8fd9\u4e9b\u53c2\u6570\u3002\u53ef\u4ee5\u901a\u8fc7\u4f4d\u7f6e\u53c2\u6570\u3001\u5173\u952e\u5b57\u53c2\u6570\u6216\u53ef\u53d8\u53c2\u6570\u7b49\u591a\u79cd\u65b9\u5f0f\u4f20\u9012\u53c2\u6570\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002<\/p>\n<p><strong>\u5982\u679c\u4e00\u4e2a\u51fd\u6570\u9700\u8981\u8fd4\u56de\u591a\u4e2a\u503c\uff0c\u5e94\u8be5\u5982\u4f55\u5b9e\u73b0\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u51fd\u6570\u53ef\u4ee5\u901a\u8fc7\u5143\u7ec4\u3001\u5217\u8868\u6216\u5b57\u5178\u7b49\u6570\u636e\u7ed3\u6784\u8fd4\u56de\u591a\u4e2a\u503c\u3002\u60a8\u53ea\u9700\u5728\u51fd\u6570\u4e2d\u4f7f\u7528\u9017\u53f7\u5206\u9694\u591a\u4e2a\u8fd4\u56de\u503c\uff0c\u7136\u540e\u5728\u8c03\u7528\u51fd\u6570\u65f6\u53ef\u4ee5\u901a\u8fc7\u89e3\u5305\u65b9\u5f0f\u83b7\u53d6\u8fd9\u4e9b\u503c\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u8fd4\u56de\u4e24\u4e2a\u6570\u7684\u548c\u4e0e\u5dee\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u5c06\u5176\u5206\u914d\u7ed9\u4e24\u4e2a\u53d8\u91cf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5b9e\u73b0\u4e24\u4e2a\u51fd\u6570\u7684\u8c03\u7528\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u76f4\u63a5\u8c03\u7528\u3001\u5d4c\u5957\u8c03\u7528\u3001\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3001\u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c\u7b49\u3002\u672c [&hellip;]","protected":false},"author":3,"featured_media":1119174,"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\/1119167"}],"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=1119167"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119167\/revisions"}],"predecessor-version":[{"id":1119175,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119167\/revisions\/1119175"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1119174"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1119167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1119167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1119167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}