{"id":1037875,"date":"2024-12-31T12:18:56","date_gmt":"2024-12-31T04:18:56","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1037875.html"},"modified":"2024-12-31T12:18:59","modified_gmt":"2024-12-31T04:18:59","slug":"python%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e7%ba%bf%e7%a8%8b%e7%9a%84%e8%bf%94%e5%9b%9e%e5%80%bc","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1037875.html","title":{"rendered":"python\u5982\u4f55\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/8776f36e-51ec-4bb0-864d-3617f361abbd.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\" \/><\/p>\n<p><p> <strong>Python\u83b7\u53d6\u7ebf\u7a0b\u8fd4\u56de\u503c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528<code>threading<\/code>\u6a21\u5757\u4e2d\u7684<code>Thread<\/code>\u7c7b\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u53ef\u53d8\u5bf9\u8c61\u4e2d\u3001\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u4e2d\u7684<code>ThreadPoolExecutor<\/code>\u7c7b\u3001\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u7c7b\u3002\u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e2d\uff0c<code>concurrent.futures<\/code>\u6a21\u5757\u7684<code>ThreadPoolExecutor<\/code>\u7c7b\u662f\u6700\u4e3a\u7b80\u4fbf\u548c\u63a8\u8350\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u9ad8\u5c42\u7684\u62bd\u8c61\u548c\u66f4\u7b80\u6d01\u7684\u4ee3\u7801\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528<code>concurrent.futures<\/code>\u4e2d\u7684<code>ThreadPoolExecutor<\/code>\u7c7b\u6765\u83b7\u53d6\u7ebf\u7a0b\u8fd4\u56de\u503c\u662f\u6700\u4e3a\u63a8\u8350\u7684\u65b9\u5f0f\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u9ad8\u5c42\u7684\u62bd\u8c61\u548c\u7b80\u6d01\u7684\u4ee3\u7801\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u65b9\u6cd5\uff0c\u5e76\u7ed9\u51fa\u76f8\u5e94\u7684\u4ee3\u7801\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528<code>threading<\/code>\u6a21\u5757\u4e2d\u7684<code>Thread<\/code>\u7c7b\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u53ef\u53d8\u5bf9\u8c61\u4e2d<\/h3>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u624b\u52a8\u7ba1\u7406\u5171\u4eab\u5bf9\u8c61\u6765\u5b58\u50a8\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\uff0c\u4f8b\u5982\u4f7f\u7528\u5217\u8868\u6216\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>def thread_function(result, index):<\/p>\n<p>    # \u6267\u884c\u4e00\u4e9b\u64cd\u4f5c\uff0c\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728result\u5217\u8868\u4e2d<\/p>\n<p>    result[index] = &quot;Thread result&quot;<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u53ef\u53d8\u5bf9\u8c61\u6765\u5b58\u50a8\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c<\/strong><\/h2>\n<p>result = [None] * 1<\/p>\n<p>threads = []<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u542f\u52a8\u7ebf\u7a0b<\/strong><\/h2>\n<p>for i in range(1):<\/p>\n<p>    thread = threading.Thread(target=thread_function, args=(result, i))<\/p>\n<p>    threads.append(thread)<\/p>\n<p>    thread.start()<\/p>\n<h2><strong>\u7b49\u5f85\u6240\u6709\u7ebf\u7a0b\u5b8c\u6210<\/strong><\/h2>\n<p>for thread in threads:<\/p>\n<p>    thread.join()<\/p>\n<h2><strong>\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c<\/strong><\/h2>\n<p>print(result[0])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u4e2d\u7684<code>ThreadPoolExecutor<\/code>\u7c7b<\/h3>\n<\/p>\n<p><p><code>ThreadPoolExecutor<\/code>\u7c7b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u5c42\u63a5\u53e3\u6765\u7ba1\u7406\u7ebf\u7a0b\u6c60\u5e76\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from concurrent.futures import ThreadPoolExecutor<\/p>\n<p>def thread_function():<\/p>\n<p>    # \u6267\u884c\u4e00\u4e9b\u64cd\u4f5c\uff0c\u5e76\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>    return &quot;Thread result&quot;<\/p>\n<h2><strong>\u521b\u5efa\u7ebf\u7a0b\u6c60<\/strong><\/h2>\n<p>with ThreadPoolExecutor(max_workers=1) as executor:<\/p>\n<p>    # \u63d0\u4ea4\u7ebf\u7a0b\u4efb\u52a1\u5e76\u83b7\u53d6Future\u5bf9\u8c61<\/p>\n<p>    future = executor.submit(thread_function)<\/p>\n<p>    # \u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c<\/p>\n<p>    result = future.result()<\/p>\n<p>print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u7c7b<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u7ee7\u627f<code>threading.Thread<\/code>\u7c7b\u5e76\u91cd\u5199\u5176<code>run<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u7c7b\u6765\u5b58\u50a8\u548c\u8fd4\u56de\u7ebf\u7a0b\u7684\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>class MyThread(threading.Thread):<\/p>\n<p>    def __init__(self):<\/p>\n<p>        super().__init__()<\/p>\n<p>        self._result = None<\/p>\n<p>    def run(self):<\/p>\n<p>        # \u6267\u884c\u4e00\u4e9b\u64cd\u4f5c\uff0c\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u5b9e\u4f8b\u53d8\u91cf\u4e2d<\/p>\n<p>        self._result = &quot;Thread result&quot;<\/p>\n<p>    def get_result(self):<\/p>\n<p>        return self._result<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u542f\u52a8\u81ea\u5b9a\u4e49\u7ebf\u7a0b<\/strong><\/h2>\n<p>thread = MyThread()<\/p>\n<p>thread.start()<\/p>\n<h2><strong>\u7b49\u5f85\u7ebf\u7a0b\u5b8c\u6210<\/strong><\/h2>\n<p>thread.join()<\/p>\n<h2><strong>\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c<\/strong><\/h2>\n<p>result = thread.get_result()<\/p>\n<p>print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u7ec6\u8282\u548c\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><h4>1\u3001\u7ebf\u7a0b\u5b89\u5168<\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528\u5171\u4eab\u5bf9\u8c61\u5b58\u50a8\u7ebf\u7a0b\u8fd4\u56de\u503c\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\u3002\u53ef\u4ee5\u4f7f\u7528\u7ebf\u7a0b\u9501\uff08<code>threading.Lock<\/code>\uff09\u6765\u786e\u4fdd\u5bf9\u5171\u4eab\u5bf9\u8c61\u7684\u8bbf\u95ee\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>def thread_function(result, index, lock):<\/p>\n<p>    with lock:<\/p>\n<p>        result[index] = &quot;Thread result&quot;<\/p>\n<p>result = [None] * 1<\/p>\n<p>lock = threading.Lock()<\/p>\n<p>threads = []<\/p>\n<p>for i in range(1):<\/p>\n<p>    thread = threading.Thread(target=thread_function, args=(result, i, lock))<\/p>\n<p>    threads.append(thread)<\/p>\n<p>    thread.start()<\/p>\n<p>for thread in threads:<\/p>\n<p>    thread.join()<\/p>\n<p>print(result[0])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5f02\u5e38\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u7f16\u7a0b\u4e2d\uff0c\u9700\u8981\u5904\u7406\u7ebf\u7a0b\u4e2d\u7684\u5f02\u5e38\uff0c\u4ee5\u907f\u514d\u7a0b\u5e8f\u5d29\u6e83\u3002\u53ef\u4ee5\u5728\u7ebf\u7a0b\u51fd\u6570\u4e2d\u6355\u83b7\u5f02\u5e38\uff0c\u5e76\u5c06\u5f02\u5e38\u4fe1\u606f\u5b58\u50a8\u5728\u5171\u4eab\u5bf9\u8c61\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>def thread_function(result, index, lock):<\/p>\n<p>    try:<\/p>\n<p>        # \u6267\u884c\u4e00\u4e9b\u64cd\u4f5c<\/p>\n<p>        r<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>se ValueError(&quot;An error occurred&quot;)<\/p>\n<p>    except Exception as e:<\/p>\n<p>        with lock:<\/p>\n<p>            result[index] = e<\/p>\n<p>result = [None] * 1<\/p>\n<p>lock = threading.Lock()<\/p>\n<p>threads = []<\/p>\n<p>for i in range(1):<\/p>\n<p>    thread = threading.Thread(target=thread_function, args=(result, i, lock))<\/p>\n<p>    threads.append(thread)<\/p>\n<p>    thread.start()<\/p>\n<p>for thread in threads:<\/p>\n<p>    thread.join()<\/p>\n<p>if isinstance(result[0], Exception):<\/p>\n<p>    print(f&quot;Thread encountered an error: {result[0]}&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(result[0])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u6027\u80fd\u548c<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/58557.html\" target=\"_blank\">\u8d44\u6e90\u7ba1\u7406<\/a><\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528\u591a\u7ebf\u7a0b\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u6027\u80fd\u548c\u8d44\u6e90\u7ba1\u7406\u95ee\u9898\u3002\u8fc7\u591a\u7684\u7ebf\u7a0b\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8d44\u6e90\u8017\u5c3d\u548c\u6027\u80fd\u4e0b\u964d\u3002\u53ef\u4ee5\u4f7f\u7528\u7ebf\u7a0b\u6c60\u6765\u9650\u5236\u5e76\u53d1\u7ebf\u7a0b\u7684\u6570\u91cf\uff0c\u5e76\u5408\u7406\u5206\u914d\u7cfb\u7edf\u8d44\u6e90\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from concurrent.futures import ThreadPoolExecutor<\/p>\n<p>def thread_function():<\/p>\n<p>    return &quot;Thread result&quot;<\/p>\n<p>with ThreadPoolExecutor(max_workers=5) as executor:<\/p>\n<p>    futures = [executor.submit(thread_function) for _ in range(10)]<\/p>\n<p>    results = [future.result() for future in futures]<\/p>\n<p>print(results)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528<code>threading<\/code>\u6a21\u5757\u4e2d\u7684<code>Thread<\/code>\u7c7b\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u53ef\u53d8\u5bf9\u8c61\u4e2d\u3001\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u4e2d\u7684<code>ThreadPoolExecutor<\/code>\u7c7b\u3001\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u7c7b\u3002\u5176\u4e2d\uff0c\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u7684<code>ThreadPoolExecutor<\/code>\u7c7b\u662f\u6700\u4e3a\u63a8\u8350\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u9ad8\u5c42\u7684\u62bd\u8c61\u548c\u66f4\u7b80\u6d01\u7684\u4ee3\u7801\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u9700\u8981\u6ce8\u610f\u7ebf\u7a0b\u5b89\u5168\u3001\u5f02\u5e38\u5904\u7406\u3001\u6027\u80fd\u548c\u8d44\u6e90\u7ba1\u7406\u7b49\u65b9\u9762\u7684\u95ee\u9898\uff0c\u4ee5\u786e\u4fdd\u591a\u7ebf\u7a0b\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u9ad8\u6548\u6027\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u80fd\u591f\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1\u5728Python\u4e2d\u83b7\u53d6\u7ebf\u7a0b\u8fd4\u56de\u503c\u7684\u65b9\u6cd5\u548c\u6280\u5de7\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u4f7f\u7528<code>threading<\/code>\u6a21\u5757\u65f6\uff0c\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\u5e76\u4e0d\u662f\u76f4\u63a5\u53ef\u7528\u7684\u3002\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5c06\u8fd4\u56de\u503c\u5b58\u50a8\u5728\u4e00\u4e2a\u5171\u4eab\u7684\u5bf9\u8c61\u4e2d\uff0c\u4f8b\u5982\u5217\u8868\u6216\u5b57\u5178\uff0c\u6216\u8005\u4f7f\u7528<code>concurrent.futures.ThreadPoolExecutor<\/code>\u6765\u83b7\u53d6\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u591a\u7ebf\u7a0b\u4efb\u52a1\u7684\u7ed3\u679c\u3002<\/p>\n<p><strong>\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f<\/strong><br \/><code>concurrent.futures<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u66f4\u7b80\u5355\u5730\u7ba1\u7406\u7ebf\u7a0b\u548c\u83b7\u53d6\u8fd4\u56de\u503c\u3002\u4f7f\u7528<code>ThreadPoolExecutor<\/code>\u53ef\u4ee5\u8f7b\u677e\u63d0\u4ea4\u4efb\u52a1\u5e76\u5728\u672a\u6765\u7684\u67d0\u4e2a\u65f6\u523b\u83b7\u53d6\u7ed3\u679c\uff0c\u8fd9\u6837\u4f60\u5c31\u4e0d\u9700\u8981\u624b\u52a8\u7ba1\u7406\u7ebf\u7a0b\u7684\u521b\u5efa\u548c\u8fd4\u56de\u503c\u7684\u6536\u96c6\u3002\u8fd9\u79cd\u65b9\u5f0f\u4f7f\u4ee3\u7801\u66f4\u6e05\u6670\uff0c\u6613\u4e8e\u7ef4\u62a4\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u7ebf\u7a0b\u5f02\u5e38\u5e76\u83b7\u53d6\u5f02\u5e38\u4fe1\u606f\uff1f<\/strong><br \/>\u5728\u4f7f\u7528\u7ebf\u7a0b\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5f02\u5e38\u3002\u82e5\u8981\u83b7\u53d6\u5f02\u5e38\u4fe1\u606f\uff0c\u53ef\u4ee5\u5728\u5b50\u7ebf\u7a0b\u4e2d\u6355\u83b7\u5f02\u5e38\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u5171\u4eab\u5bf9\u8c61\u4e2d\uff0c\u6216\u8005\u4f7f\u7528<code>Future<\/code>\u5bf9\u8c61\u7684<code>result()<\/code>\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u4f1a\u5728\u83b7\u53d6\u7ed3\u679c\u65f6\u629b\u51fa\u5f02\u5e38\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e3b\u7ebf\u7a0b\u80fd\u591f\u5904\u7406\u5b50\u7ebf\u7a0b\u4e2d\u7684\u9519\u8bef\uff0c\u907f\u514d\u7a0b\u5e8f\u5d29\u6e83\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u901a\u8fc7\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u7ebf\u7a0b\u7684\u8fd4\u56de\u503c\u3002\u5728<code>concurrent.futures<\/code>\u6a21\u5757\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>add_done_callback()<\/code>\u65b9\u6cd5\u4e3a\u6bcf\u4e2a\u4efb\u52a1\u6dfb\u52a0\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5728\u4efb\u52a1\u5b8c\u6210\u65f6\u81ea\u52a8\u5904\u7406\u8fd4\u56de\u503c\u6216\u5f02\u5e38\uff0c\u4ece\u800c\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u7ed3\u679c\u5904\u7406\u673a\u5236\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u83b7\u53d6\u7ebf\u7a0b\u8fd4\u56de\u503c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528threading\u6a21\u5757\u4e2d\u7684Thread\u7c7b\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u53ef\u53d8\u5bf9\u8c61\u4e2d\u3001\u4f7f [&hellip;]","protected":false},"author":3,"featured_media":1037889,"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\/1037875"}],"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=1037875"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1037875\/revisions"}],"predecessor-version":[{"id":1037891,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1037875\/revisions\/1037891"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1037889"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1037875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1037875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1037875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}