{"id":935440,"date":"2024-12-26T18:53:24","date_gmt":"2024-12-26T10:53:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/935440.html"},"modified":"2024-12-26T18:53:26","modified_gmt":"2024-12-26T10:53:26","slug":"python-%e5%a6%82%e4%bd%95%e5%85%b3%e9%97%ad%e8%bf%9b%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/935440.html","title":{"rendered":"python \u5982\u4f55\u5173\u95ed\u8fdb\u7a0b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072034\/2e8625f8-ab78-4597-b144-61210788195c.webp\" alt=\"python \u5982\u4f55\u5173\u95ed\u8fdb\u7a0b\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5173\u95ed\u8fdb\u7a0b\u7684\u5e38\u7528\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528os.kill()\u3001subprocess.Popen\u5bf9\u8c61\u7684terminate()\u548ckill()\u65b9\u6cd5\u3001\u4ee5\u53ca\u4f7f\u7528\u4fe1\u53f7\u6a21\u5757\u53d1\u9001\u4fe1\u53f7\u7b49\u3002\u5176\u4e2d\uff0cos.kill()\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7\u53d1\u9001\u4fe1\u53f7\u6765\u7ec8\u6b62\u8fdb\u7a0b\uff0csubprocess\u6a21\u5757\u63d0\u4f9b\u7684Popen\u5bf9\u8c61\u7684terminate()\u548ckill()\u65b9\u6cd5\u5219\u53ef\u4ee5\u76f4\u63a5\u7ec8\u6b62\u5b50\u8fdb\u7a0b\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8be6\u7ec6\u63cf\u8ff0\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\u8fdb\u7a0b\u548c\u4fe1\u53f7\u7684\u57fa\u672c\u6982\u5ff5\u3002\u8fdb\u7a0b\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u8fd0\u884c\u7a0b\u5e8f\u7684\u5b9e\u4f8b\uff0c\u901a\u5e38\u7531\u591a\u4e2a\u7ebf\u7a0b\u7ec4\u6210\u3002\u4fe1\u53f7\u662f\u8fdb\u7a0b\u95f4\u901a\u4fe1\u7684\u4e00\u79cd\u673a\u5236\uff0c\u53ef\u4ee5\u7528\u4e8e\u901a\u77e5\u8fdb\u7a0b\u6267\u884c\u67d0\u4e9b\u64cd\u4f5c\uff0c\u4f8b\u5982\u7ec8\u6b62\u3001\u6682\u505c\u6216\u7ee7\u7eed\u6267\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528os.kill()\u5173\u95ed\u8fdb\u7a0b<\/h3>\n<\/p>\n<p><p><code>os.kill()<\/code>\u65b9\u6cd5\u901a\u8fc7\u5411\u6307\u5b9a\u7684\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u6765\u7ec8\u6b62\u8fdb\u7a0b\u3002\u5728Unix\u7cfb\u7edf\u4e2d\uff0c\u5e38\u7528\u7684\u4fe1\u53f7\u5305\u62ecSIGTERM\u3001SIGKILL\u7b49\u3002SIGTERM\u662f\u8bf7\u6c42\u8fdb\u7a0b\u7ec8\u6b62\u7684\u4fe1\u53f7\uff0c\u8fdb\u7a0b\u53ef\u4ee5\u6355\u83b7\u5e76\u5904\u7406\u5b83\uff1b\u800cSIGKILL\u662f\u5f3a\u5236\u7ec8\u6b62\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff0c\u65e0\u6cd5\u88ab\u8fdb\u7a0b\u6355\u83b7\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>import signal<\/p>\n<h2><strong>\u83b7\u53d6\u8fdb\u7a0bID<\/strong><\/h2>\n<p>pid = 12345  # \u66ff\u6362\u4e3a\u76ee\u6807\u8fdb\u7a0b\u7684PID<\/p>\n<h2><strong>\u53d1\u9001SIGTERM\u4fe1\u53f7\u4ee5\u8bf7\u6c42\u8fdb\u7a0b\u7ec8\u6b62<\/strong><\/h2>\n<p>os.kill(pid, signal.SIGTERM)<\/p>\n<h2><strong>\u6216\u8005\u53d1\u9001SIGKILL\u4fe1\u53f7\u4ee5\u5f3a\u5236\u7ec8\u6b62\u8fdb\u7a0b<\/strong><\/h2>\n<p>os.kill(pid, signal.SIGKILL)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>os.kill()\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u7cbe\u786e\u63a7\u5236\u53d1\u9001\u7684\u4fe1\u53f7\u7c7b\u578b\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5bf9\u4e0d\u540c\u7c7b\u578b\u4fe1\u53f7\u8fdb\u884c\u5904\u7406\u7684\u573a\u666f\u3002<\/strong>\u4f46\u662f\uff0c\u5b83\u8981\u6c42\u8c03\u7528\u8005\u5177\u6709\u8db3\u591f\u7684\u6743\u9650\u6765\u53d1\u9001\u4fe1\u53f7\u7ed9\u76ee\u6807\u8fdb\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528subprocess\u6a21\u5757\u5173\u95ed\u5b50\u8fdb\u7a0b<\/h3>\n<\/p>\n<p><p><code>subprocess<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5b50\u8fdb\u7a0b\u7ba1\u7406\u529f\u80fd\uff0c\u5176\u4e2d<code>Popen<\/code>\u5bf9\u8c61\u7684<code>terminate()<\/code>\u548c<code>kill()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5173\u95ed\u5b50\u8fdb\u7a0b\u3002<code>terminate()<\/code>\u65b9\u6cd5\u53d1\u9001SIGTERM\u4fe1\u53f7\uff0c\u800c<code>kill()<\/code>\u65b9\u6cd5\u53d1\u9001SIGKILL\u4fe1\u53f7\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<h2><strong>\u542f\u52a8\u5b50\u8fdb\u7a0b<\/strong><\/h2>\n<p>process = subprocess.Popen([&#39;some_command&#39;])<\/p>\n<h2><strong>\u7ec8\u6b62\u5b50\u8fdb\u7a0b<\/strong><\/h2>\n<p>process.terminate()  # \u53d1\u9001SIGTERM\u4fe1\u53f7<\/p>\n<h2><strong>\u6216\u8005\u5f3a\u5236\u7ec8\u6b62\u5b50\u8fdb\u7a0b<\/strong><\/h2>\n<p>process.kill()  # \u53d1\u9001SIGKILL\u4fe1\u53f7<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528subprocess\u6a21\u5757\u5173\u95ed\u8fdb\u7a0b\u7684\u4f18\u70b9\u662f\u7b80\u6d01\u6613\u7528\uff0c\u9002\u5408\u5728Python\u7a0b\u5e8f\u4e2d\u7ba1\u7406\u81ea\u542f\u52a8\u7684\u5b50\u8fdb\u7a0b\u3002<\/strong>\u7136\u800c\uff0c<code>terminate()<\/code>\u65b9\u6cd5\u53ef\u80fd\u4f1a\u88ab\u8fdb\u7a0b\u5ffd\u7565\uff0c\u56e0\u6b64\u5728\u5fc5\u8981\u65f6\u9700\u8981\u4f7f\u7528<code>kill()<\/code>\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u4fe1\u53f7\u6a21\u5757\u5904\u7406\u8fdb\u7a0b\u4fe1\u53f7<\/h3>\n<\/p>\n<p><p>\u5728Python\u7a0b\u5e8f\u4e2d\uff0c<code>signal<\/code>\u6a21\u5757\u5141\u8bb8\u6355\u83b7\u548c\u5904\u7406\u4fe1\u53f7\u3002\u5f53\u9700\u8981\u4f18\u96c5\u5730\u5173\u95ed\u8fdb\u7a0b\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49\u4fe1\u53f7\u5904\u7406\u51fd\u6570\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import signal<\/p>\n<p>import time<\/p>\n<p>def handle_signal(signum, frame):<\/p>\n<p>    print(f&quot;Received signal {signum}, shutting down...&quot;)<\/p>\n<p>    # \u6267\u884c\u6e05\u7406\u64cd\u4f5c<\/p>\n<p>    exit(0)<\/p>\n<h2><strong>\u6ce8\u518c\u4fe1\u53f7\u5904\u7406\u51fd\u6570<\/strong><\/h2>\n<p>signal.signal(signal.SIGTERM, handle_signal)<\/p>\n<h2><strong>\u6a21\u62df\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u4efb\u52a1<\/strong><\/h2>\n<p>while True:<\/p>\n<p>    print(&quot;Running...&quot;)<\/p>\n<p>    time.sleep(1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u4fe1\u53f7\u6a21\u5757\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4fe1\u53f7\u5904\u7406\u903b\u8f91\uff0c\u5b9e\u73b0\u4f18\u96c5\u7684\u8fdb\u7a0b\u5173\u95ed\u3002<\/strong>\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fe1\u53f7\u5904\u7406\u51fd\u6570\u5e94\u8be5\u5c3d\u91cf\u7b80\u5355\uff0c\u4ee5\u907f\u514d\u6f5c\u5728\u7684\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3\u4e0e\u6269\u5c55<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong>\uff1a\u5173\u95ed\u8fdb\u7a0b\u65f6\u9700\u8981\u5177\u6709\u8db3\u591f\u7684\u6743\u9650\u3002\u4f8b\u5982\uff0c\u666e\u901a\u7528\u6237\u65e0\u6cd5\u7ec8\u6b62\u7cfb\u7edf\u8fdb\u7a0b\u6216\u5176\u4ed6\u7528\u6237\u7684\u8fdb\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8de8\u5e73\u53f0\u517c\u5bb9\u6027<\/strong>\uff1a<code>os.kill()<\/code>\u548c<code>signal<\/code>\u6a21\u5757\u4e3b\u8981\u5728Unix\u7cfb\u7edf\u4e0a\u4f7f\u7528\uff0c\u800c\u5728Windows\u4e0a\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\uff0c\u5982<code>psutil<\/code>\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528psutil\u6a21\u5757<\/strong>\uff1a<code>psutil<\/code>\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684Python\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u8fdb\u7a0b\u7ba1\u7406\u529f\u80fd\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7<code>psutil.Process<\/code>\u5bf9\u8c61\u7684<code>terminate()<\/code>\u548c<code>kill()<\/code>\u65b9\u6cd5\u5173\u95ed\u8fdb\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import psutil<\/p>\n<h2><strong>\u83b7\u53d6\u8fdb\u7a0b\u5bf9\u8c61<\/strong><\/h2>\n<p>process = psutil.Process(pid)<\/p>\n<h2><strong>\u7ec8\u6b62\u8fdb\u7a0b<\/strong><\/h2>\n<p>process.terminate()<\/p>\n<h2><strong>\u6216\u8005\u5f3a\u5236\u7ec8\u6b62\u8fdb\u7a0b<\/strong><\/h2>\n<p>process.kill()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>psutil\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u83b7\u53d6\u8fdb\u7a0b\u4fe1\u606f\u3001\u76d1\u63a7\u7cfb\u7edf\u8d44\u6e90\u7b49\uff0c\u9002\u5408\u9700\u8981\u590d\u6742\u8fdb\u7a0b\u7ba1\u7406\u7684\u5e94\u7528\u573a\u666f\u3002<\/strong><\/p>\n<\/p>\n<ol start=\"4\">\n<li>\n<p><strong>\u4f18\u96c5\u5173\u95ed<\/strong>\uff1a\u5982\u679c\u8fdb\u7a0b\u6d89\u53ca<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/58557.html\" target=\"_blank\">\u8d44\u6e90\u7ba1\u7406<\/a>\uff08\u5982\u6587\u4ef6\u3001\u7f51\u7edc\u8fde\u63a5\u7b49\uff09\uff0c\u5efa\u8bae\u5728\u5173\u95ed\u524d\u6267\u884c\u5fc5\u8981\u7684\u6e05\u7406\u64cd\u4f5c\uff0c\u4ee5\u907f\u514d\u8d44\u6e90\u6cc4\u6f0f\u6216\u6570\u636e\u635f\u574f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fe1\u53f7\u91cf\u7684\u4f7f\u7528<\/strong>\uff1a\u5728\u591a\u8fdb\u7a0b\u5e94\u7528\u4e2d\uff0c\u4fe1\u53f7\u91cf\u53ef\u4ee5\u5e2e\u52a9\u534f\u8c03\u8fdb\u7a0b\u5173\u95ed\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>multiprocessing<\/code>\u6a21\u5757\u4e2d\u7684<code>Event<\/code>\u5bf9\u8c61\u6765\u901a\u77e5\u8fdb\u7a0b\u5b89\u5168\u9000\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from multiprocessing import Process, Event<\/p>\n<p>import time<\/p>\n<p>def worker(stop_event):<\/p>\n<p>    while not stop_event.is_set():<\/p>\n<p>        print(&quot;Working...&quot;)<\/p>\n<p>        time.sleep(1)<\/p>\n<h2><strong>\u521b\u5efa\u4e8b\u4ef6\u5bf9\u8c61<\/strong><\/h2>\n<p>stop_event = Event()<\/p>\n<h2><strong>\u542f\u52a8\u5b50\u8fdb\u7a0b<\/strong><\/h2>\n<p>p = Process(target=worker, args=(stop_event,))<\/p>\n<p>p.start()<\/p>\n<h2><strong>\u6a21\u62df\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4<\/strong><\/h2>\n<p>time.sleep(5)<\/p>\n<h2><strong>\u89e6\u53d1\u4e8b\u4ef6\u4ee5\u7ec8\u6b62\u5b50\u8fdb\u7a0b<\/strong><\/h2>\n<p>stop_event.set()<\/p>\n<p>p.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u603b\u7ed3<\/strong>\uff1a\u5728Python\u4e2d\u5173\u95ed\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u3002<code>os.kill()<\/code>\u548c<code>signal<\/code>\u6a21\u5757\u9002\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u4fe1\u53f7\u63a7\u5236\u7684\u573a\u666f\uff0c<code>subprocess<\/code>\u6a21\u5757\u5219\u9002\u5408\u7ba1\u7406\u81ea\u542f\u52a8\u7684\u5b50\u8fdb\u7a0b\uff0c\u800c<code>psutil<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u8fdb\u7a0b\u7ba1\u7406\u529f\u80fd\u3002\u6b64\u5916\uff0c\u5728\u8bbe\u8ba1\u5e94\u7528\u65f6\uff0c\u8981\u8003\u8651\u6743\u9650\u3001\u8de8\u5e73\u53f0\u517c\u5bb9\u6027\u548c\u8d44\u6e90\u7ba1\u7406\u7b49\u56e0\u7d20\uff0c\u4ee5\u786e\u4fdd\u8fdb\u7a0b\u5173\u95ed\u7684\u5b89\u5168\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u5173\u95ed\u7279\u5b9a\u8fdb\u7a0b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os<\/code>\u6a21\u5757\u7684<code>kill<\/code>\u51fd\u6570\u6765\u5173\u95ed\u7279\u5b9a\u7684\u8fdb\u7a0b\u3002\u9996\u5148\uff0c\u9700\u8981\u83b7\u53d6\u8be5\u8fdb\u7a0b\u7684PID\uff08\u8fdb\u7a0bID\uff09\uff0c\u7136\u540e\u4f7f\u7528<code>os.kill(pid, signal.SIGTERM)<\/code>\u6765\u53d1\u9001\u7ec8\u6b62\u4fe1\u53f7\u3002\u786e\u4fdd\u5728\u5173\u95ed\u8fdb\u7a0b\u524d\uff0c\u60a8\u5df2\u7ecf\u4e86\u89e3\u8be5\u8fdb\u7a0b\u662f\u5426\u53ef\u4ee5\u5b89\u5168\u5173\u95ed\uff0c\u4ee5\u907f\u514d\u6570\u636e\u4e22\u5931\u6216\u5176\u4ed6\u95ee\u9898\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u7528\u4e8e\u7ba1\u7406\u548c\u5173\u95ed\u8fdb\u7a0b\uff1f<\/strong><br \/>Python\u7684\u6807\u51c6\u5e93\u63d0\u4f9b\u4e86<code>os<\/code>\u548c<code>signal<\/code>\u6a21\u5757\u7528\u4e8e\u5904\u7406\u8fdb\u7a0b\u3002\u9664\u6b64\u4e4b\u5916\uff0c<code>psutil<\/code>\u5e93\u4e5f\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u7cfb\u7edf\u548c\u8fdb\u7a0b\u4fe1\u606f\uff0c\u5e76\u4e14\u652f\u6301\u65b9\u4fbf\u5730\u7ec8\u6b62\u8fdb\u7a0b\u3002\u53ef\u4ee5\u901a\u8fc7<code>psutil.Process(pid).terminate()<\/code>\u6765\u5173\u95ed\u6307\u5b9a\u7684\u8fdb\u7a0b\u3002<\/p>\n<p><strong>\u5173\u95ed\u8fdb\u7a0b\u65f6\u53ef\u80fd\u9047\u5230\u54ea\u4e9b\u9519\u8bef\uff1f<\/strong><br \/>\u5728\u5173\u95ed\u8fdb\u7a0b\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6743\u9650\u4e0d\u8db3\u3001\u8fdb\u7a0b\u4e0d\u5b58\u5728\u6216\u8fdb\u7a0b\u672a\u54cd\u5e94\u7b49\u9519\u8bef\u3002\u4e3a\u4e86\u786e\u4fdd\u6210\u529f\u5173\u95ed\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u5f02\u5e38\u5904\u7406\u6765\u6355\u6349\u8fd9\u4e9b\u9519\u8bef\uff0c\u5e76\u76f8\u5e94\u5730\u5904\u7406\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>try<\/code>\u548c<code>except<\/code>\u8bed\u53e5\u6355\u83b7<code>ProcessLookupError<\/code>\u6216<code>PermissionError<\/code>\uff0c\u4ee5\u4fbf\u8fdb\u884c\u9002\u5f53\u7684\u9519\u8bef\u5904\u7406\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5173\u95ed\u8fdb\u7a0b\u7684\u5e38\u7528\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528os.kill()\u3001subprocess.Popen\u5bf9\u8c61\u7684termi [&hellip;]","protected":false},"author":3,"featured_media":935443,"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\/935440"}],"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=935440"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/935440\/revisions"}],"predecessor-version":[{"id":935447,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/935440\/revisions\/935447"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/935443"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=935440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=935440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=935440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}