{"id":1160030,"date":"2025-01-13T19:00:10","date_gmt":"2025-01-13T11:00:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1160030.html"},"modified":"2025-01-13T19:00:13","modified_gmt":"2025-01-13T11:00:13","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e5%86%99%e5%a4%9a%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1160030.html","title":{"rendered":"\u5982\u4f55\u7528python\u5199\u591a\u4ee3\u7801"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25201627\/4d480516-7cc2-48c7-b2bc-5a5094e4f988.webp\" alt=\"\u5982\u4f55\u7528python\u5199\u591a\u4ee3\u7801\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u7f16\u5199\u591a\u7ebf\u7a0b\u4ee3\u7801\u3001\u4f7f\u7528\u591a\u8fdb\u7a0b\u3001\u4f7f\u7528\u5f02\u6b65\u7f16\u7a0b<\/strong>\u662f\u5b9e\u73b0\u5e76\u53d1\u7f16\u7a0b\u7684\u4e09\u79cd\u5e38\u89c1\u65b9\u6cd5\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u7f16\u5199\u9ad8\u6548\u7684\u5e76\u53d1\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u591a\u7ebf\u7a0b<\/h3>\n<\/p>\n<p><p><strong>\u591a\u7ebf\u7a0b\u662f\u6307\u5728\u4e00\u4e2a\u8fdb\u7a0b\u5185\u521b\u5efa\u591a\u4e2a\u7ebf\u7a0b\uff0c\u7ebf\u7a0b\u662fCPU\u8c03\u5ea6\u7684\u57fa\u672c\u5355\u4f4d\u3002<\/strong>Python\u901a\u8fc7<code>threading<\/code>\u6a21\u5757\u6765\u5b9e\u73b0\u591a\u7ebf\u7a0b\u7f16\u7a0b\u3002\u5728Python\u4e2d\uff0c\u7531\u4e8e\u5168\u5c40\u89e3\u91ca\u5668\u9501\uff08GIL\uff09\u7684\u5b58\u5728\uff0c\u591a\u7ebf\u7a0b\u5728\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\u4e2d\u5e76\u4e0d\u80fd\u771f\u6b63\u5e76\u884c\u6267\u884c\uff0c\u4f46\u662f\u5bf9\u4e8eI\/O\u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u591a\u7ebf\u7a0b\u4ecd\u7136\u662f\u975e\u5e38\u6709\u6548\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><h4>1.1 \u521b\u5efa\u5e76\u542f\u52a8\u7ebf\u7a0b<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u7ee7\u627f<code>threading.Thread<\/code>\u7c7b\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u81ea\u5df1\u7684\u7ebf\u7a0b\u7c7b\uff0c\u5e76\u91cd\u5199<code>run<\/code>\u65b9\u6cd5\u6765\u5b9a\u4e49\u7ebf\u7a0b\u7684\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>import time<\/p>\n<p>class MyThread(threading.Thread):<\/p>\n<p>    def __init__(self, name):<\/p>\n<p>        threading.Thread.__init__(self)<\/p>\n<p>        self.name = name<\/p>\n<p>    def run(self):<\/p>\n<p>        print(f&quot;Thread {self.name} started&quot;)<\/p>\n<p>        time.sleep(2)<\/p>\n<p>        print(f&quot;Thread {self.name} finished&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u542f\u52a8\u7ebf\u7a0b<\/strong><\/h2>\n<p>thread1 = MyThread(&quot;A&quot;)<\/p>\n<p>thread2 = MyThread(&quot;B&quot;)<\/p>\n<p>thread1.start()<\/p>\n<p>thread2.start()<\/p>\n<p>thread1.join()<\/p>\n<p>thread2.join()<\/p>\n<p>print(&quot;All threads completed&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>1.2 \u7ebf\u7a0b\u540c\u6b65<\/h4>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u7f16\u7a0b\u4e2d\uff0c\u6570\u636e\u5171\u4eab\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7ade\u4e89\u6761\u4ef6\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7ebf\u7a0b\u540c\u6b65\u673a\u5236\uff0c\u4f8b\u5982\u9501\uff08Lock\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>import time<\/p>\n<p>class <a href=\"https:\/\/docs.pingcode.com\/agile\/agile-at-scale\/what-is-safe\" target=\"_blank\">SAFe<\/a>Counter:<\/p>\n<p>    def __init__(self):<\/p>\n<p>        self.lock = threading.Lock()<\/p>\n<p>        self.count = 0<\/p>\n<p>    def increment(self):<\/p>\n<p>        with self.lock:<\/p>\n<p>            temp = self.count<\/p>\n<p>            time.sleep(0.1)<\/p>\n<p>            self.count = temp + 1<\/p>\n<p>counter = SafeCounter()<\/p>\n<p>def worker():<\/p>\n<p>    for _ in range(10):<\/p>\n<p>        counter.increment()<\/p>\n<p>threads = []<\/p>\n<p>for _ in range(5):<\/p>\n<p>    t = threading.Thread(target=worker)<\/p>\n<p>    threads.append(t)<\/p>\n<p>    t.start()<\/p>\n<p>for t in threads:<\/p>\n<p>    t.join()<\/p>\n<p>print(f&quot;Final count: {counter.count}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u591a\u8fdb\u7a0b<\/h3>\n<\/p>\n<p><p><strong>\u591a\u8fdb\u7a0b\u662f\u6307\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u521b\u5efa\u591a\u4e2a\u8fdb\u7a0b\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u6709\u72ec\u7acb\u7684\u5185\u5b58\u7a7a\u95f4\u3002<\/strong>Python\u901a\u8fc7<code>multiprocessing<\/code>\u6a21\u5757\u6765\u5b9e\u73b0\u591a\u8fdb\u7a0b\u7f16\u7a0b\u3002\u591a\u8fdb\u7a0b\u53ef\u4ee5\u7ed5\u8fc7GIL\u7684\u9650\u5236\uff0c\u771f\u6b63\u5b9e\u73b0\u5e76\u884c\u8ba1\u7b97\uff0c\u975e\u5e38\u9002\u5408\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h4>2.1 \u521b\u5efa\u5e76\u542f\u52a8\u8fdb\u7a0b<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u7ee7\u627f<code>multiprocessing.Process<\/code>\u7c7b\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u81ea\u5df1\u7684\u8fdb\u7a0b\u7c7b\uff0c\u5e76\u91cd\u5199<code>run<\/code>\u65b9\u6cd5\u6765\u5b9a\u4e49\u8fdb\u7a0b\u7684\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import multiprocessing<\/p>\n<p>import time<\/p>\n<p>class MyProcess(multiprocessing.Process):<\/p>\n<p>    def __init__(self, name):<\/p>\n<p>        multiprocessing.Process.__init__(self)<\/p>\n<p>        self.name = name<\/p>\n<p>    def run(self):<\/p>\n<p>        print(f&quot;Process {self.name} started&quot;)<\/p>\n<p>        time.sleep(2)<\/p>\n<p>        print(f&quot;Process {self.name} finished&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u542f\u52a8\u8fdb\u7a0b<\/strong><\/h2>\n<p>process1 = MyProcess(&quot;A&quot;)<\/p>\n<p>process2 = MyProcess(&quot;B&quot;)<\/p>\n<p>process1.start()<\/p>\n<p>process2.start()<\/p>\n<p>process1.join()<\/p>\n<p>process2.join()<\/p>\n<p>print(&quot;All processes completed&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2.2 \u8fdb\u7a0b\u95f4\u901a\u4fe1<\/h4>\n<\/p>\n<p><p>\u5728\u591a\u8fdb\u7a0b\u7f16\u7a0b\u4e2d\uff0c\u8fdb\u7a0b\u95f4\u901a\u4fe1\uff08IPC\uff09\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7ba1\u9053\uff08Pipe\uff09\u548c\u961f\u5217\uff08Queue\uff09\u6765\u5b9e\u73b0\u8fdb\u7a0b\u95f4\u901a\u4fe1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import multiprocessing<\/p>\n<p>def worker(pipe):<\/p>\n<p>    pipe.send(&quot;Hello from child process!&quot;)<\/p>\n<p>    print(f&quot;Child process received: {pipe.recv()}&quot;)<\/p>\n<p>parent_conn, child_conn = multiprocessing.Pipe()<\/p>\n<p>p = multiprocessing.Process(target=worker, args=(child_conn,))<\/p>\n<p>p.start()<\/p>\n<p>print(f&quot;Parent process received: {parent_conn.recv()}&quot;)<\/p>\n<p>parent_conn.send(&quot;Hello from parent process!&quot;)<\/p>\n<p>p.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5f02\u6b65\u7f16\u7a0b<\/h3>\n<\/p>\n<p><p><strong>\u5f02\u6b65\u7f16\u7a0b\u662f\u4e00\u79cd\u5e76\u53d1\u7f16\u7a0b\u7684\u8303\u5f0f\uff0c\u901a\u8fc7\u5f02\u6b65I\/O\u64cd\u4f5c\u5b9e\u73b0\u5e76\u53d1\u3002<\/strong>Python\u901a\u8fc7<code>asyncio<\/code>\u6a21\u5757\u6765\u5b9e\u73b0\u5f02\u6b65\u7f16\u7a0b\u3002\u5f02\u6b65\u7f16\u7a0b\u5728\u5904\u7406\u5927\u91cfI\/O\u5bc6\u96c6\u578b\u4efb\u52a1\u65f6\u975e\u5e38\u9ad8\u6548\u3002<\/p>\n<\/p>\n<p><h4>3.1 \u5b9a\u4e49\u5f02\u6b65\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u4f7f\u7528<code>async def<\/code>\u5173\u952e\u5b57\u6765\u5b9a\u4e49\u5f02\u6b65\u51fd\u6570\uff0c\u5e76\u4f7f\u7528<code>aw<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>t<\/code>\u5173\u952e\u5b57\u6765\u6267\u884c\u5f02\u6b65\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import asyncio<\/p>\n<p>async def say_hello(name):<\/p>\n<p>    print(f&quot;Hello {name}!&quot;)<\/p>\n<p>    await asyncio.sleep(1)<\/p>\n<p>    print(f&quot;Goodbye {name}!&quot;)<\/p>\n<p>async def main():<\/p>\n<p>    await asyncio.gather(<\/p>\n<p>        say_hello(&quot;Alice&quot;),<\/p>\n<p>        say_hello(&quot;Bob&quot;),<\/p>\n<p>    )<\/p>\n<p>asyncio.run(main())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3.2 \u5f02\u6b65\u4efb\u52a1\u8c03\u5ea6<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>asyncio.create_task<\/code>\u51fd\u6570\u6765\u521b\u5efa\u5f02\u6b65\u4efb\u52a1\uff0c\u5e76\u8c03\u5ea6\u6267\u884c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import asyncio<\/p>\n<p>async def say_hello(name):<\/p>\n<p>    print(f&quot;Hello {name}!&quot;)<\/p>\n<p>    await asyncio.sleep(1)<\/p>\n<p>    print(f&quot;Goodbye {name}!&quot;)<\/p>\n<p>async def main():<\/p>\n<p>    task1 = asyncio.create_task(say_hello(&quot;Alice&quot;))<\/p>\n<p>    task2 = asyncio.create_task(say_hello(&quot;Bob&quot;))<\/p>\n<p>    await task1<\/p>\n<p>    await task2<\/p>\n<p>asyncio.run(main())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408\u591a\u79cd\u6280\u672f<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\u591a\u7ebf\u7a0b\u3001\u591a\u8fdb\u7a0b\u548c\u5f02\u6b65\u7f16\u7a0b\u6765\u5b9e\u73b0\u9ad8\u6548\u7684\u5e76\u53d1\u7a0b\u5e8f\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7ed3\u5408\u591a\u8fdb\u7a0b\u548c\u5f02\u6b65\u7f16\u7a0b\u7684\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import multiprocessing<\/p>\n<p>import asyncio<\/p>\n<p>def worker(pipe):<\/p>\n<p>    async def async_task():<\/p>\n<p>        print(&quot;Async task started&quot;)<\/p>\n<p>        await asyncio.sleep(1)<\/p>\n<p>        print(&quot;Async task finished&quot;)<\/p>\n<p>    async def main():<\/p>\n<p>        await async_task()<\/p>\n<p>        pipe.send(&quot;Message from async task&quot;)<\/p>\n<p>    asyncio.run(main())<\/p>\n<p>parent_conn, child_conn = multiprocessing.Pipe()<\/p>\n<p>p = multiprocessing.Process(target=worker, args=(child_conn,))<\/p>\n<p>p.start()<\/p>\n<p>print(f&quot;Parent process received: {parent_conn.recv()}&quot;)<\/p>\n<p>p.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5e76\u53d1\u7f16\u7a0b\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u591a\u7ebf\u7a0b\u3001\u591a\u8fdb\u7a0b\u548c\u5f02\u6b65\u7f16\u7a0b\u3002<strong>\u591a\u7ebf\u7a0b\u9002\u7528\u4e8eI\/O\u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u591a\u8fdb\u7a0b\u9002\u7528\u4e8e\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u800c\u5f02\u6b65\u7f16\u7a0b\u9002\u7528\u4e8e\u5927\u91cfI\/O\u64cd\u4f5c\u7684\u4efb\u52a1\u3002<\/strong>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e76\u53d1\u7f16\u7a0b\u65b9\u6cd5\uff0c\u5e76\u7ed3\u5408\u4f7f\u7528\u591a\u79cd\u6280\u672f\u6765\u5b9e\u73b0\u9ad8\u6548\u7684\u5e76\u53d1\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u4ee3\u7801\u91cd\u7528\uff1f<\/strong><br \/>\u5728Python\u4e2d\u5b9e\u73b0\u4ee3\u7801\u91cd\u7528\u7684\u5e38\u89c1\u65b9\u6cd5\u662f\u901a\u8fc7\u5b9a\u4e49\u51fd\u6570\u548c\u7c7b\u3002\u51fd\u6570\u5141\u8bb8\u60a8\u5c06\u4ee3\u7801\u5757\u5c01\u88c5\u5728\u4e00\u4e2a\u53ef\u91cd\u590d\u8c03\u7528\u7684\u5355\u4f4d\u4e2d\uff0c\u800c\u7c7b\u5219\u63d0\u4f9b\u4e86\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u80fd\u529b\uff0c\u4f7f\u60a8\u80fd\u591f\u521b\u5efa\u5177\u6709\u7279\u5b9a\u5c5e\u6027\u548c\u65b9\u6cd5\u7684\u5bf9\u8c61\u3002\u4f7f\u7528\u6a21\u5757\u548c\u5305\u4e5f\u662f\u4e00\u79cd\u6709\u6548\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06\u529f\u80fd\u5206\u5f00\u5e76\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u5171\u4eab\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u7f16\u5199\u4ee3\u7801\u65f6\uff0c\u600e\u6837\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u63d0\u9ad8Python\u4ee3\u7801\u53ef\u8bfb\u6027\u7684\u91cd\u8981\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u6709\u610f\u4e49\u7684\u53d8\u91cf\u548c\u51fd\u6570\u547d\u540d\u3001\u9075\u5faaPEP 8\u7f16\u7801\u89c4\u8303\u3001\u5408\u7406\u4f7f\u7528\u6ce8\u91ca\u548c\u6587\u6863\u5b57\u7b26\u4e32\u3002\u4fdd\u6301\u4ee3\u7801\u7ed3\u6784\u6e05\u6670\uff0c\u907f\u514d\u8fc7\u957f\u7684\u51fd\u6570\u6216\u7c7b\u4e5f\u662f\u63d0\u5347\u53ef\u8bfb\u6027\u7684\u5173\u952e\u3002\u9002\u5f53\u7684\u7f29\u8fdb\u548c\u7a7a\u884c\u6709\u52a9\u4e8e\u589e\u5f3a\u4ee3\u7801\u7684\u5c42\u6b21\u611f\uff0c\u4f7f\u5176\u66f4\u6613\u4e8e\u7406\u89e3\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u8fdb\u884c\u4ee3\u7801\u8c03\u8bd5\u548c\u6d4b\u8bd5\uff1f<\/strong><br \/>\u5728Python\u4e2d\u8fdb\u884c\u4ee3\u7801\u8c03\u8bd5\u548c\u6d4b\u8bd5\u7684\u5e38\u7528\u5de5\u5177\u5305\u62ec\u5185\u7f6e\u7684pdb\u8c03\u8bd5\u5668\u3001pytest\u6d4b\u8bd5\u6846\u67b6\u548cunittest\u6a21\u5757\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u6267\u884c\u4ee3\u7801\u6765\u68c0\u67e5\u53d8\u91cf\u7684\u72b6\u6001\uff0c\u4ee5\u53ca\u4f7f\u7528\u65ad\u8a00\u8bed\u53e5\u6765\u9a8c\u8bc1\u4ee3\u7801\u884c\u4e3a\u3002\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u53ef\u4ee5\u5e2e\u52a9\u786e\u4fdd\u60a8\u7684\u4ee3\u7801\u5728\u4fee\u6539\u540e\u4ecd\u7136\u6b63\u5e38\u5de5\u4f5c\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u7f16\u5199\u591a\u7ebf\u7a0b\u4ee3\u7801\u3001\u4f7f\u7528\u591a\u8fdb\u7a0b\u3001\u4f7f\u7528\u5f02\u6b65\u7f16\u7a0b\u662f\u5b9e\u73b0\u5e76\u53d1\u7f16\u7a0b\u7684\u4e09\u79cd\u5e38\u89c1\u65b9\u6cd5\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Py [&hellip;]","protected":false},"author":3,"featured_media":1160036,"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\/1160030"}],"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=1160030"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1160030\/revisions"}],"predecessor-version":[{"id":1160039,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1160030\/revisions\/1160039"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1160036"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1160030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1160030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1160030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}