{"id":1000006,"date":"2024-12-27T09:46:13","date_gmt":"2024-12-27T01:46:13","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1000006.html"},"modified":"2024-12-27T09:46:35","modified_gmt":"2024-12-27T01:46:35","slug":"python-%e5%a6%82%e4%bd%95%e9%98%b2%e6%ad%a2%e9%87%8d%e5%a4%8d%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1000006.html","title":{"rendered":"python \u5982\u4f55\u9632\u6b62\u91cd\u590d\u8fd0\u884c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074801\/36cea204-0324-42c9-b310-8b14420cbc90.webp\" alt=\"python \u5982\u4f55\u9632\u6b62\u91cd\u590d\u8fd0\u884c\" \/><\/p>\n<p><p> <strong>\u8981\u9632\u6b62Python\u7a0b\u5e8f\u91cd\u590d\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u4ef6\u9501\u3001\u8fdb\u7a0b\u9501\u3001\u68c0\u67e5\u8fdb\u7a0b\u8868\u7b49\u65b9\u6cd5\u3002<\/strong>\u5176\u4e2d\uff0c\u6587\u4ef6\u9501\u662f\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u5b83\u901a\u8fc7\u5728\u6587\u4ef6\u7cfb\u7edf\u4e0a\u521b\u5efa\u4e00\u4e2a\u9501\u6587\u4ef6\u6765\u786e\u4fdd\u7a0b\u5e8f\u7684\u552f\u4e00\u6027\u3002\u4ee5\u4e0b\u662f\u5bf9\u6587\u4ef6\u9501\u7684\u8be6\u7ec6\u63cf\u8ff0\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u6587\u4ef6\u9501\u53ef\u4ee5\u6709\u6548\u5730\u9632\u6b62\u7a0b\u5e8f\u7684\u91cd\u590d\u8fd0\u884c\u3002\u5f53\u7a0b\u5e8f\u542f\u52a8\u65f6\uff0c\u5b83\u4f1a\u5c1d\u8bd5\u5728\u7cfb\u7edf\u4e0a\u521b\u5efa\u4e00\u4e2a\u552f\u4e00\u7684\u9501\u6587\u4ef6\u3002\u5982\u679c\u9501\u6587\u4ef6\u5df2\u7ecf\u5b58\u5728\uff0c\u5219\u8bf4\u660e\u7a0b\u5e8f\u6b63\u5728\u8fd0\u884c\uff0c\u65b0\u7684\u5b9e\u4f8b\u5c06\u65e0\u6cd5\u542f\u52a8\u3002\u5b9e\u73b0\u6587\u4ef6\u9501\u901a\u5e38\u6d89\u53ca\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u9996\u5148\uff0c\u5728\u7a0b\u5e8f\u542f\u52a8\u65f6\u68c0\u67e5\u9501\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff1b\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5219\u521b\u5efa\u8be5\u6587\u4ef6\u5e76\u7ee7\u7eed\u6267\u884c\u7a0b\u5e8f\uff1b\u5982\u679c\u5b58\u5728\uff0c\u5219\u7ec8\u6b62\u7a0b\u5e8f\u6216\u7b49\u5f85\u5df2\u8fd0\u884c\u7684\u5b9e\u4f8b\u7ed3\u675f\u3002\u9501\u6587\u4ef6\u53ef\u4ee5\u5305\u542b\u5f53\u524d\u8fdb\u7a0b\u7684PID\uff0c\u4ee5\u4fbf\u5728\u7a0b\u5e8f\u5f02\u5e38\u7ec8\u6b62\u65f6\u6e05\u7406\u9501\u6587\u4ef6\u3002<\/p>\n<\/p>\n<hr>\n<p><p>\u4e00\u3001\u6587\u4ef6\u9501<\/p>\n<\/p>\n<p><p>\u6587\u4ef6\u9501\u662f\u4e00\u79cd\u7b80\u5355\u4e14\u6709\u6548\u7684\u65b9\u6cd5\u6765\u9632\u6b62\u91cd\u590d\u8fd0\u884c\u3002\u5b83\u901a\u8fc7\u5728\u6587\u4ef6\u7cfb\u7edf\u4e0a\u521b\u5efa\u4e00\u4e2a\u9501\u6587\u4ef6\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b9e\u73b0\u6587\u4ef6\u9501<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u5b9e\u73b0\u6587\u4ef6\u9501\uff0c\u9996\u5148\u9700\u8981\u5728\u7a0b\u5e8f\u542f\u52a8\u65f6\u68c0\u67e5\u9501\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5982\u679c\u9501\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5219\u521b\u5efa\u8be5\u6587\u4ef6\u5e76\u7ee7\u7eed\u6267\u884c\u7a0b\u5e8f\uff1b\u5982\u679c\u5b58\u5728\uff0c\u5219\u7a0b\u5e8f\u7ec8\u6b62\u6216\u7b49\u5f85\u5df2\u8fd0\u884c\u7684\u5b9e\u4f8b\u7ed3\u675f\u3002\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>os<\/code>\u6a21\u5757\u6765\u64cd\u4f5c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>import sys<\/p>\n<p>lock_file = &#39;\/tmp\/my_program.lock&#39;<\/p>\n<p>if os.path.exists(lock_file):<\/p>\n<p>    print(&quot;Program is already running.&quot;)<\/p>\n<p>    sys.exit()<\/p>\n<p>else:<\/p>\n<p>    with open(lock_file, &#39;w&#39;) as f:<\/p>\n<p>        f.write(str(os.getpid()))<\/p>\n<h2><strong>Your program logic here<\/strong><\/h2>\n<p>os.remove(lock_file)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9501\u6587\u4ef6\u7684\u6e05\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7a0b\u5e8f\u6b63\u5e38\u9000\u51fa\u65f6\uff0c\u8981\u8bb0\u5f97\u5220\u9664\u9501\u6587\u4ef6\u3002\u5982\u679c\u7a0b\u5e8f\u5f02\u5e38\u7ec8\u6b62\uff0c\u53ef\u4ee5\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u68c0\u67e5\u9501\u6587\u4ef6\u662f\u5426\u8fc7\u671f\uff0c\u6216\u8005\u4f7f\u7528\u5305\u542bPID\u7684\u9501\u6587\u4ef6\u6765\u9a8c\u8bc1\u8fdb\u7a0b\u662f\u5426\u4f9d\u7136\u5b58\u5728\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u8fdb\u7a0b\u9501<\/p>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\u73af\u5883\u4e0b\uff0c\u4f7f\u7528\u8fdb\u7a0b\u9501\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u91cd\u590d\u8fd0\u884c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u7ebf\u7a0b\u9501<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>threading<\/code>\u6a21\u5757\u7684<code>Lock<\/code>\u5bf9\u8c61\u6765\u5b9e\u73b0\u7ebf\u7a0b\u9501\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>lock = threading.Lock()<\/p>\n<p>def critical_section():<\/p>\n<p>    with lock:<\/p>\n<p>        # Code that should not be executed by multiple threads<\/p>\n<p>        pass<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u8fdb\u7a0b\u9501<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u591a\u8fdb\u7a0b\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>multiprocessing<\/code>\u6a21\u5757\u7684<code>Lock<\/code>\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from multiprocessing import Lock<\/p>\n<p>lock = Lock()<\/p>\n<p>def critical_section():<\/p>\n<p>    with lock:<\/p>\n<p>        # Code that should not be executed by multiple processes<\/p>\n<p>        pass<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u68c0\u67e5\u8fdb\u7a0b\u8868<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u68c0\u67e5\u7cfb\u7edf\u7684\u8fdb\u7a0b\u8868\uff0c\u786e\u5b9a\u7a0b\u5e8f\u662f\u5426\u5df2\u7ecf\u5728\u8fd0\u884c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528<code>psutil<\/code>\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><p><code>psutil<\/code>\u6a21\u5757\u53ef\u4ee5\u7528\u6765\u904d\u5386\u7cfb\u7edf\u8fdb\u7a0b\uff0c\u68c0\u67e5\u5f53\u524d\u7a0b\u5e8f\u662f\u5426\u5df2\u5728\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import psutil<\/p>\n<p>import os<\/p>\n<p>def is_running():<\/p>\n<p>    current_pid = os.getpid()<\/p>\n<p>    for proc in psutil.process_iter([&#39;pid&#39;, &#39;name&#39;]):<\/p>\n<p>        if proc.info[&#39;name&#39;] == &#39;my_program_name&#39; and proc.info[&#39;pid&#39;] != current_pid:<\/p>\n<p>            return True<\/p>\n<p>    return False<\/p>\n<p>if is_running():<\/p>\n<p>    print(&quot;Program is already running.&quot;)<\/p>\n<p>    sys.exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fdb\u7a0b\u540d\u548cPID<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u68c0\u67e5\u8fdb\u7a0b\u8868\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fdb\u7a0b\u540d\u6216PID\u8fdb\u884c\u66f4\u7cbe\u786e\u7684\u5224\u65ad\u3002\u540c\u65f6\uff0c\u786e\u4fdd\u7a0b\u5e8f\u7684\u540d\u79f0\u5728\u7cfb\u7edf\u4e2d\u662f\u552f\u4e00\u7684\uff0c\u4ee5\u907f\u514d\u8bef\u5224\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u624b\u52a8\u5b9e\u73b0\u6587\u4ef6\u9501\u548c\u8fdb\u7a0b\u9501\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u548c\u53ef\u9760\u7684\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong><code>fasteners<\/code>\u5e93<\/strong><\/p>\n<\/p>\n<p><p><code>fasteners<\/code>\u5e93\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u6587\u4ef6\u9501\u5b9e\u73b0\uff0c\u5e76\u652f\u6301\u8de8\u5e73\u53f0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import fasteners<\/p>\n<p>lock_file = &#39;\/tmp\/my_program.lock&#39;<\/p>\n<p>lock = fasteners.InterProcessLock(lock_file)<\/p>\n<p>if lock.acquire(blocking=False):<\/p>\n<p>    try:<\/p>\n<p>        # Your program logic here<\/p>\n<p>        pass<\/p>\n<p>    finally:<\/p>\n<p>        lock.release()<\/p>\n<p>else:<\/p>\n<p>    print(&quot;Program is already running.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong><code>portalocker<\/code>\u5e93<\/strong><\/p>\n<\/p>\n<p><p><code>portalocker<\/code>\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684\u6587\u4ef6\u9501\u5e93\uff0c\u63d0\u4f9b\u4e86\u7b80\u5355\u6613\u7528\u7684API\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import portalocker<\/p>\n<p>lock_file = &#39;\/tmp\/my_program.lock&#39;<\/p>\n<p>with open(lock_file, &#39;w&#39;) as f:<\/p>\n<p>    try:<\/p>\n<p>        portalocker.lock(f, portalocker.LOCK_EX | portalocker.LOCK_NB)<\/p>\n<p>        # Your program logic here<\/p>\n<p>    except portalocker.LockException:<\/p>\n<p>        print(&quot;Program is already running.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u7cfb\u7edf\u670d\u52a1\u548c\u5b88\u62a4\u8fdb\u7a0b<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u957f\u671f\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u8003\u8651\u5c06\u5176\u8bbe\u8ba1\u4e3a\u7cfb\u7edf\u670d\u52a1\u6216\u5b88\u62a4\u8fdb\u7a0b\uff0c\u4ee5\u907f\u514d\u91cd\u590d\u5b9e\u4f8b\u7684\u542f\u52a8\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528<code>systemd<\/code>\u670d\u52a1<\/strong><\/p>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528<code>systemd<\/code>\u5c06\u7a0b\u5e8f\u914d\u7f6e\u4e3a\u670d\u52a1\uff0c\u4ee5\u786e\u4fdd\u5355\u5b9e\u4f8b\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-ini\">[Unit]<\/p>\n<p>Description=My Python Service<\/p>\n<p>[Service]<\/p>\n<p>ExecStart=\/usr\/bin\/python3 \/path\/to\/my_program.py<\/p>\n<p>Restart=always<\/p>\n<p>[Install]<\/p>\n<p>WantedBy=multi-user.target<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u5b88\u62a4\u8fdb\u7a0b<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Python\u7684<code>daemon<\/code>\u5e93\uff0c\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u5b88\u62a4\u8fdb\u7a0b\u7a0b\u5e8f\uff0c\u786e\u4fdd\u5176\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u5e76\u9632\u6b62\u91cd\u590d\u542f\u52a8\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import daemon<\/p>\n<p>with daemon.DaemonContext():<\/p>\n<p>    # Your program logic here<\/p>\n<p>    pass<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u9632\u6b62Python\u7a0b\u5e8f\u7684\u91cd\u590d\u8fd0\u884c\u3002\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u7a0b\u5e8f\u7684\u590d\u6742\u6027\u3001\u8fd0\u884c\u73af\u5883\u4ee5\u53ca\u5177\u4f53\u9700\u6c42\u3002\u786e\u4fdd\u5728\u5b9e\u73b0\u65f6\u8003\u8651\u5230\u7a0b\u5e8f\u7684\u6b63\u5e38\u9000\u51fa\u548c\u5f02\u5e38\u5904\u7406\uff0c\u4ee5\u9632\u6b62\u9501\u6587\u4ef6\u7684\u9057\u7559\u548c\u4e0d\u5fc5\u8981\u7684\u8d44\u6e90\u5360\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u4fdd\u6211\u7684Python\u811a\u672c\u4e0d\u4f1a\u88ab\u91cd\u590d\u8fd0\u884c\uff1f<\/strong><br \/>\u4e3a\u4e86\u9632\u6b62Python\u811a\u672c\u7684\u91cd\u590d\u8fd0\u884c\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\u3002\u4e00\u4e2a\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u6587\u4ef6\u9501\u673a\u5236\u3002\u5728\u811a\u672c\u5f00\u59cb\u65f6\u521b\u5efa\u4e00\u4e2a\u9501\u6587\u4ef6\uff0c\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\uff0c\u5219\u8868\u793a\u811a\u672c\u6b63\u5728\u8fd0\u884c\uff0c\u7a0b\u5e8f\u53ef\u4ee5\u9009\u62e9\u9000\u51fa\u6216\u7b49\u5f85\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u6570\u636e\u5e93\u8bb0\u5f55\u8fd0\u884c\u72b6\u6001\u4e5f\u662f\u4e00\u79cd\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7\u5728\u6570\u636e\u5e93\u4e2d\u8bbe\u7f6e\u4e00\u4e2a\u6807\u5fd7\u4f4d\u6765\u5224\u65ad\u5f53\u524d\u811a\u672c\u662f\u5426\u5728\u8fd0\u884c\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u73b0\u6210\u7684\u5e93\u53ef\u4ee5\u5e2e\u52a9\u6211\u9632\u6b62Python\u811a\u672c\u91cd\u590d\u6267\u884c\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u6709\u4e00\u4e9b\u73b0\u6210\u7684\u5e93\u53ef\u4ee5\u5e2e\u52a9\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd\u3002\u4f8b\u5982\uff0c<code>filelock<\/code>\u5e93\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u6587\u4ef6\u9501\uff0c\u4ece\u800c\u9632\u6b62\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u6267\u884c\u540c\u4e00\u4e2a\u811a\u672c\u3002\u4f7f\u7528<code>flock<\/code>\u547d\u4ee4\u6216<code>multiprocessing<\/code>\u6a21\u5757\u4e2d\u7684\u9501\u5bf9\u8c61\u4e5f\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u8fd9\u4e9b\u65b9\u6cd5\u90fd\u53ef\u4ee5\u6709\u6548\u5730\u907f\u514d\u91cd\u590d\u8fd0\u884c\u95ee\u9898\u3002<\/p>\n<p><strong>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\uff0c\u5982\u4f55\u9632\u6b62Python\u811a\u672c\u7684\u91cd\u590d\u6267\u884c\uff1f<\/strong><br \/>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ebf\u7a0b\u9501\uff08\u5982<code>threading.Lock<\/code>\uff09\u6765\u786e\u4fdd\u5728\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u53ef\u4ee5\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u5757\u3002\u901a\u8fc7\u5728\u5173\u952e\u4ee3\u7801\u524d\u540e\u52a0\u4e0a\u9501\u7684\u83b7\u53d6\u548c\u91ca\u653e\u64cd\u4f5c\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406\u5e76\u53d1\u6267\u884c\uff0c\u907f\u514d\u51fa\u73b0\u91cd\u590d\u8fd0\u884c\u7684\u60c5\u51b5\u3002\u540c\u65f6\uff0c\u8003\u8651\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u6765\u6807\u8bb0\u811a\u672c\u7684\u6267\u884c\u72b6\u6001\uff0c\u4ee5\u589e\u5f3a\u7ebf\u7a0b\u95f4\u7684\u534f\u8c03\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u9632\u6b62Python\u7a0b\u5e8f\u91cd\u590d\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u4ef6\u9501\u3001\u8fdb\u7a0b\u9501\u3001\u68c0\u67e5\u8fdb\u7a0b\u8868\u7b49\u65b9\u6cd5\u3002\u5176\u4e2d\uff0c\u6587\u4ef6\u9501\u662f\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u5b83\u901a\u8fc7 [&hellip;]","protected":false},"author":3,"featured_media":1000045,"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\/1000006"}],"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=1000006"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000006\/revisions"}],"predecessor-version":[{"id":1000049,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000006\/revisions\/1000049"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1000045"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1000006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1000006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1000006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}