{"id":965849,"date":"2024-12-27T04:41:52","date_gmt":"2024-12-26T20:41:52","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/965849.html"},"modified":"2024-12-27T04:41:54","modified_gmt":"2024-12-26T20:41:54","slug":"python-%e5%a6%82%e4%bd%95%e5%bc%ba%e5%88%b6%e7%bb%93%e6%9d%9f%e7%ba%bf%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/965849.html","title":{"rendered":"python \u5982\u4f55\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24181926\/7a03cc0b-5baf-4f53-a4ca-ab5e46ba4a92.webp\" alt=\"python \u5982\u4f55\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b\" \/><\/p>\n<p><p> <strong>Python\u4e2d\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>_thread<\/code>\u6a21\u5757\u7684<code>_thread.interrupt_m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n()<\/code>\u3001\u4f7f\u7528\u7ebf\u7a0b\u7684\u5b88\u62a4\u6a21\u5f0f\u3001\u8bbe\u7f6e\u7ebf\u7a0b\u9000\u51fa\u6807\u5fd7\u6765\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b\u3002<\/strong> \u5728Python\u4e2d\uff0c\u7ebf\u7a0b\u7684\u7ba1\u7406\u76f8\u5bf9\u590d\u6742\uff0c\u56e0\u4e3aPython\u7684\u5168\u5c40\u89e3\u91ca\u5668\u9501\uff08GIL\uff09\u4f7f\u5f97\u7ebf\u7a0b\u65e0\u6cd5\u771f\u6b63\u5e76\u884c\u6267\u884c\u3002\u56e0\u6b64\uff0c\u5f3a\u5236\u7ec8\u6b62\u7ebf\u7a0b\u5e76\u4e0d\u662f\u76f4\u63a5\u901a\u8fc7\u67d0\u4e2a\u7b80\u5355\u7684\u51fd\u6570\u8c03\u7528\u5c31\u80fd\u5b9e\u73b0\u7684\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u51e0\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u7ebf\u7a0b\u7684\u5b88\u62a4\u6a21\u5f0f<\/p>\n<\/p>\n<p><p>Python\u4e2d\u7684\u7ebf\u7a0b\u5e93\u63d0\u4f9b\u4e86\u4e00\u79cd\u79f0\u4e3a\u201c\u5b88\u62a4\u7ebf\u7a0b\u201d\u7684\u673a\u5236\u3002\u5b88\u62a4\u7ebf\u7a0b\u4f1a\u5728\u4e3b\u7ebf\u7a0b\u9000\u51fa\u65f6\u81ea\u52a8\u7ec8\u6b62\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u90a3\u4e9b\u4e0d\u9700\u8981\u5b8c\u6210\u67d0\u4e2a\u7279\u5b9a\u4efb\u52a1\u7684\u8f85\u52a9\u7ebf\u7a0b\u3002<\/p>\n<\/p>\n<ul>\n<li>\u5b88\u62a4\u7ebf\u7a0b\u7684\u8bbe\u7f6e<\/li>\n<\/ul>\n<p><p>\u8981\u5c06\u4e00\u4e2a\u7ebf\u7a0b\u8bbe\u7f6e\u4e3a\u5b88\u62a4\u7ebf\u7a0b\uff0c\u53ef\u4ee5\u5728\u542f\u52a8\u7ebf\u7a0b\u4e4b\u524d\u8c03\u7528<code>setDaemon(True)<\/code>\u6216\u5728\u521b\u5efa\u7ebf\u7a0b\u65f6\u4f20\u5165<code>daemon=True<\/code>\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>import time<\/p>\n<p>def worker():<\/p>\n<p>    while True:<\/p>\n<p>        print(&quot;Thread is running&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<p>thread = threading.Thread(target=worker)<\/p>\n<p>thread.setDaemon(True)<\/p>\n<p>thread.start()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>worker<\/code>\u7ebf\u7a0b\u88ab\u8bbe\u7f6e\u4e3a\u5b88\u62a4\u7ebf\u7a0b\uff0c\u5f53\u4e3b\u7ebf\u7a0b\u7ed3\u675f\u65f6\uff0c<code>worker<\/code>\u7ebf\u7a0b\u4f1a\u81ea\u52a8\u7ec8\u6b62\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u5b88\u62a4\u7ebf\u7a0b\u7684\u6ce8\u610f\u4e8b\u9879<\/li>\n<\/ul>\n<p><p>\u5b88\u62a4\u7ebf\u7a0b\u4e0d\u5e94\u8be5\u7528\u4e8e\u9700\u8981\u786e\u4fdd\u5b8c\u6210\u7684\u4efb\u52a1\uff0c\u56e0\u4e3a\u5b83\u4eec\u4f1a\u5728\u4e3b\u7ebf\u7a0b\u9000\u51fa\u65f6\u88ab\u5f3a\u5236\u7ec8\u6b62\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4efb\u52a1\u672a\u5b8c\u6210\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u7ebf\u7a0b\u9000\u51fa\u6807\u5fd7<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u4f5c\u4e3a\u9000\u51fa\u6807\u5fd7\uff0c\u53ef\u4ee5\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8bbe\u7f6e\u8be5\u6807\u5fd7\uff0c\u5b50\u7ebf\u7a0b\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\u5b9a\u671f\u68c0\u67e5\u8be5\u6807\u5fd7\uff0c\u4ece\u800c\u5b9e\u73b0\u7ebf\u7a0b\u7684\u4f18\u96c5\u9000\u51fa\u3002<\/p>\n<\/p>\n<ul>\n<li>\u8bbe\u7f6e\u9000\u51fa\u6807\u5fd7<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>import time<\/p>\n<p>exit_flag = False<\/p>\n<p>def worker():<\/p>\n<p>    global exit_flag<\/p>\n<p>    while not exit_flag:<\/p>\n<p>        print(&quot;Thread is running&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<p>thread = threading.Thread(target=worker)<\/p>\n<p>thread.start()<\/p>\n<p>time.sleep(5)<\/p>\n<p>exit_flag = True<\/p>\n<p>thread.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>exit_flag<\/code>\u662f\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\uff0c\u7528\u4e8e\u6307\u793a\u7ebf\u7a0b\u662f\u5426\u5e94\u8be5\u9000\u51fa\u3002<code>worker<\/code>\u7ebf\u7a0b\u5728\u6bcf\u6b21\u5faa\u73af\u4e2d\u68c0\u67e5\u8fd9\u4e2a\u6807\u5fd7\uff0c\u5982\u679c\u6807\u5fd7\u88ab\u8bbe\u7f6e\u4e3aTrue\uff0c\u7ebf\u7a0b\u4f1a\u9000\u51fa\u5faa\u73af\u5e76\u7ec8\u6b62\u6267\u884c\u3002<\/p>\n<\/p>\n<ul>\n<li>\u8bbe\u7f6e\u9000\u51fa\u6807\u5fd7\u7684\u4f18\u70b9\u548c\u7f3a\u70b9<\/li>\n<\/ul>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u7b80\u5355\u6613\u7528\u4e14\u4e0d\u4f9d\u8d56\u4e8e\u4efb\u4f55\u5916\u90e8\u5e93\uff0c\u4f46\u7f3a\u70b9\u662f\u9700\u8981\u7ebf\u7a0b\u5b9a\u671f\u68c0\u67e5\u9000\u51fa\u6807\u5fd7\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u7ebf\u7a0b\u65e0\u6cd5\u7acb\u5373\u54cd\u5e94\u9000\u51fa\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528<code>_thread<\/code>\u6a21\u5757\u7684<code>_thread.interrupt_main()<\/code><\/p>\n<\/p>\n<p><p>\u867d\u7136Python\u7684<code>threading<\/code>\u6a21\u5757\u4e0d\u76f4\u63a5\u652f\u6301\u5f3a\u5236\u7ec8\u6b62\u7ebf\u7a0b\uff0c\u4f46\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u4f4e\u7ea7\u7684<code>_thread<\/code>\u6a21\u5757\u6765\u5b9e\u73b0\u7c7b\u4f3c\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>_thread.interrupt_main()<\/code><\/li>\n<\/ul>\n<p><p><code>_thread.interrupt_main()<\/code>\u51fd\u6570\u7528\u4e8e\u5728\u5b50\u7ebf\u7a0b\u4e2d\u5f15\u53d1\u4e00\u4e2aKeyboardInterrupt\u5f02\u5e38\uff0c\u4ece\u800c\u4e2d\u65ad\u4e3b\u7ebf\u7a0b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import _thread<\/p>\n<p>import time<\/p>\n<p>def worker():<\/p>\n<p>    time.sleep(5)<\/p>\n<p>    _thread.interrupt_main()<\/p>\n<p>try:<\/p>\n<p>    thread = threading.Thread(target=worker)<\/p>\n<p>    thread.start()<\/p>\n<p>    while True:<\/p>\n<p>        print(&quot;Main thread is running&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<p>except KeyboardInterrupt:<\/p>\n<p>    print(&quot;Main thread interrupted&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>worker<\/code>\u7ebf\u7a0b\u4f1a\u57285\u79d2\u540e\u8c03\u7528<code>_thread.interrupt_main()<\/code>\uff0c\u4ece\u800c\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u5f15\u53d1\u4e00\u4e2aKeyboardInterrupt\u5f02\u5e38\uff0c\u4f7f\u5f97\u4e3b\u7ebf\u7a0b\u53ef\u4ee5\u4e2d\u65ad\u5176\u6267\u884c\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>_thread.interrupt_main()<\/code>\u7684\u6ce8\u610f\u4e8b\u9879<\/li>\n<\/ul>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u6fc0\u8fdb\uff0c\u56e0\u4e3a\u5b83\u4f1a\u5bfc\u81f4\u6574\u4e2a\u7a0b\u5e8f\u9000\u51fa\uff0c\u56e0\u6b64\u4f7f\u7528\u65f6\u9700\u8981\u7279\u522b\u5c0f\u5fc3\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/p>\n<\/p>\n<p><p>\u6709\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7075\u6d3b\u548c\u5b89\u5168\u7684\u7ebf\u7a0b\u7ba1\u7406\u529f\u80fd\uff0c\u6bd4\u5982<code>concurrent.futures<\/code>\u6a21\u5757\u548c<code>multiprocessing<\/code>\u6a21\u5757\u3002<\/p>\n<\/p>\n<ul>\n<li><code>concurrent.futures.ThreadPoolExecutor<\/code><\/li>\n<\/ul>\n<p><p>\u4f7f\u7528<code>concurrent.futures<\/code>\u6a21\u5757\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u7ebf\u7a0b\u6c60\uff0c\u5e76\u5728\u9700\u8981\u65f6\u53d6\u6d88\u672a\u5b8c\u6210\u7684\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from concurrent.futures import ThreadPoolExecutor<\/p>\n<p>import time<\/p>\n<p>def worker():<\/p>\n<p>    while True:<\/p>\n<p>        print(&quot;Thread is running&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<p>with ThreadPoolExecutor(max_workers=1) as executor:<\/p>\n<p>    future = executor.submit(worker)<\/p>\n<p>    time.sleep(5)<\/p>\n<p>    future.cancel()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>ThreadPoolExecutor<\/code>\u6765\u7ba1\u7406\u7ebf\u7a0b\uff0c\u5e76\u57285\u79d2\u540e\u53d6\u6d88\u672a\u5b8c\u6210\u7684\u4efb\u52a1\u3002<\/p>\n<\/p>\n<ul>\n<li><code>multiprocessing<\/code>\u6a21\u5757<\/li>\n<\/ul>\n<p><p>\u867d\u7136<code>multiprocessing<\/code>\u6a21\u5757\u4e3b\u8981\u7528\u4e8e\u591a\u8fdb\u7a0b\u7f16\u7a0b\uff0c\u4f46\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u6bd4\u7ebf\u7a0b\u66f4\u4e3a\u7075\u6d3b\u7684\u5e76\u53d1\u6a21\u578b\uff0c\u53ef\u4ee5\u901a\u8fc7\u7ec8\u6b62\u8fdb\u7a0b\u6765\u5b9e\u73b0\u7c7b\u4f3c\u4e8e\u7ec8\u6b62\u7ebf\u7a0b\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from multiprocessing import Process<\/p>\n<p>import time<\/p>\n<p>def worker():<\/p>\n<p>    while True:<\/p>\n<p>        print(&quot;Process is running&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<p>process = Process(target=worker)<\/p>\n<p>process.start()<\/p>\n<p>time.sleep(5)<\/p>\n<p>process.terminate()<\/p>\n<p>process.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>Process<\/code>\u6765\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u8fdb\u7a0b\uff0c\u5e76\u57285\u79d2\u540e\u901a\u8fc7<code>terminate()<\/code>\u65b9\u6cd5\u7ec8\u6b62\u8be5\u8fdb\u7a0b\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c<strong>\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b\u5e76\u4e0d\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u64cd\u4f5c<\/strong>\uff0c\u56e0\u4e3aPython\u7684\u7ebf\u7a0b\u5e93\u6ca1\u6709\u63d0\u4f9b\u76f4\u63a5\u7ec8\u6b62\u7ebf\u7a0b\u7684\u65b9\u6cd5\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<strong>\u4f7f\u7528\u5b88\u62a4\u7ebf\u7a0b\u3001\u8bbe\u7f6e\u9000\u51fa\u6807\u5fd7\u3001\u4f7f\u7528\u4f4e\u7ea7\u7684_thread\u6a21\u5757\u3001\u6216\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/strong>\u6765\u5b9e\u73b0\u7ebf\u7a0b\u7684\u7ec8\u6b62\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\uff0c\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u3002\u5728\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u7279\u522b\u6ce8\u610f\u7ebf\u7a0b\u7684\u5b89\u5168\u6027\u548c\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8d44\u6e90\u6cc4\u6f0f\u548c\u9519\u8bef\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\uff0c\u5982\u4f55\u4f18\u96c5\u5730\u505c\u6b62\u4e00\u4e2a\u7ebf\u7a0b\uff1f<\/strong><br \/>\u4e3a\u4e86\u4f18\u96c5\u5730\u505c\u6b62\u7ebf\u7a0b\uff0c\u53ef\u4ee5\u4f7f\u7528\u6807\u5fd7\u4f4d\uff08\u5982<code>Event<\/code>\u5bf9\u8c61\uff09\u6765\u63a7\u5236\u7ebf\u7a0b\u7684\u8fd0\u884c\u72b6\u6001\u3002\u5728\u7ebf\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u5b9a\u671f\u68c0\u67e5\u8fd9\u4e2a\u6807\u5fd7\u4f4d\uff0c\u5e76\u5728\u5176\u88ab\u8bbe\u7f6e\u65f6\u5b89\u5168\u5730\u9000\u51fa\u7ebf\u7a0b\u3002\u8fd9\u79cd\u65b9\u5f0f\u907f\u514d\u4e86\u5f3a\u5236\u7ec8\u6b62\u7ebf\u7a0b\u53ef\u80fd\u5bfc\u81f4\u7684\u8d44\u6e90\u6cc4\u6f0f\u6216\u6570\u636e\u4e0d\u4e00\u81f4\u3002<\/p>\n<p><strong>\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b\u53ef\u80fd\u5e26\u6765\u54ea\u4e9b\u6f5c\u5728\u95ee\u9898\uff1f<\/strong><br \/>\u5f3a\u5236\u7ed3\u675f\u7ebf\u7a0b\uff08\u4f8b\u5982\u4f7f\u7528<code>Thread._stop()<\/code>\uff09\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u4e0d\u53ef\u9884\u77e5\u7684\u95ee\u9898\uff0c\u5982\u8d44\u6e90\u672a\u91ca\u653e\u3001\u9501\u672a\u89e3\u9501\u6216\u6570\u636e\u635f\u574f\u7b49\u3002\u7531\u4e8e\u7ebf\u7a0b\u7684\u72b6\u6001\u548c\u5171\u4eab\u6570\u636e\u7684\u590d\u6742\u6027\uff0c\u5f3a\u5236\u7ec8\u6b62\u7ebf\u7a0b\u901a\u5e38\u662f\u4e0d\u63a8\u8350\u7684\u505a\u6cd5\uff0c\u5efa\u8bae\u4f7f\u7528\u66f4\u5b89\u5168\u7684\u65b9\u6cd5\u6765\u7ba1\u7406\u7ebf\u7a0b\u7684\u751f\u547d\u5468\u671f\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6709\u54ea\u4e9b\u7ebf\u7a0b\u7ba1\u7406\u7684\u6700\u4f73\u5b9e\u8df5\uff1f<\/strong><br \/>\u7ba1\u7406\u7ebf\u7a0b\u65f6\uff0c\u9075\u5faa\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>Thread.join()<\/code>\u65b9\u6cd5\u7b49\u5f85\u7ebf\u7a0b\u5b8c\u6210\u3001\u4f7f\u7528\u9501\u673a\u5236\u6765\u4fdd\u8bc1\u6570\u636e\u7684\u4e00\u81f4\u6027\u3001\u4ee5\u53ca\u4f7f\u7528<code>Queue<\/code>\u6a21\u5757\u8fdb\u884c\u5b89\u5168\u7684\u6570\u636e\u4ea4\u6362\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u907f\u514d\u7ade\u4e89\u6761\u4ef6\u548c\u6b7b\u9501\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u4e2d\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528_thread\u6a21\u5757\u7684_thread.interrupt_mAIn()\u3001\u4f7f\u7528\u7ebf\u7a0b\u7684\u5b88\u62a4 [&hellip;]","protected":false},"author":3,"featured_media":965859,"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\/965849"}],"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=965849"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/965849\/revisions"}],"predecessor-version":[{"id":965861,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/965849\/revisions\/965861"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/965859"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=965849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=965849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=965849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}