{"id":987367,"date":"2024-12-27T07:53:02","date_gmt":"2024-12-26T23:53:02","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/987367.html"},"modified":"2024-12-27T07:53:04","modified_gmt":"2024-12-26T23:53:04","slug":"python%e5%a6%82%e4%bd%95%e5%81%9c%e6%ad%a2%e8%bf%90%e8%a1%8c6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/987367.html","title":{"rendered":"python\u5982\u4f55\u505c\u6b62\u8fd0\u884c6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25063518\/5d87c566-4dc5-49e5-ab5d-d25dd6bc8039.webp\" alt=\"python\u5982\u4f55\u505c\u6b62\u8fd0\u884c6\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u505c\u6b62\u8fd0\u884c\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528\u952e\u76d8\u4e2d\u65ad\u3001sys.exit()\u51fd\u6570\u3001os._exit()\u51fd\u6570\u3001\u4ee5\u53ca\u901a\u8fc7\u8bbe\u7f6e\u6807\u5fd7\u53d8\u91cf\u63a7\u5236\u5faa\u73af\u7b49\u3002<\/strong> \u5176\u4e2d\uff0c<strong>sys.exit()<\/strong> \u662f\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5728\u7a0b\u5e8f\u9047\u5230\u7279\u5b9a\u6761\u4ef6\u65f6\u9000\u51fa\u3002sys.exit() \u51fd\u6570\u4f1a\u629b\u51fa\u4e00\u4e2a SystemExit \u5f02\u5e38\uff0c\u4ece\u800c\u7ec8\u6b62 Python \u89e3\u91ca\u5668\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u8ba8\u8bba\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u952e\u76d8\u4e2d\u65ad<\/p>\n<\/p>\n<p><p>\u952e\u76d8\u4e2d\u65ad\u662f\u6307\u7528\u6237\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u6309\u4e0b\u7279\u5b9a\u7684\u952e\u76d8\u7ec4\u5408\uff08\u901a\u5e38\u662f Ctrl+C\uff09\u6765\u7ec8\u6b62\u7a0b\u5e8f\u3002\u8fd9\u4e2a\u65b9\u6cd5\u9002\u7528\u4e8e\u5927\u591a\u6570\u4ea4\u4e92\u5f0f Python \u7a0b\u5e8f\u3002Python \u89e3\u91ca\u5668\u5728\u68c0\u6d4b\u5230\u952e\u76d8\u4e2d\u65ad\u540e\uff0c\u4f1a\u5f15\u53d1\u4e00\u4e2a KeyboardInterrupt \u5f02\u5e38\u3002\u5982\u679c\u4f60\u5e0c\u671b\u5728\u7ec8\u6b62\u7a0b\u5e8f\u65f6\u6267\u884c\u4e00\u4e9b\u6e05\u7406\u64cd\u4f5c\uff0c\u53ef\u4ee5\u6355\u83b7\u8fd9\u4e2a\u5f02\u5e38\u5e76\u5728 except \u8bed\u53e5\u5757\u4e2d\u6dfb\u52a0\u76f8\u5e94\u7684\u5904\u7406\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    while True:<\/p>\n<p>        # \u6a21\u62df\u4e00\u4e2a\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u4efb\u52a1<\/p>\n<p>        pass<\/p>\n<p>except KeyboardInterrupt:<\/p>\n<p>    print(&quot;\u7a0b\u5e8f\u5df2\u88ab\u7528\u6237\u7ec8\u6b62&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528 sys.exit() \u51fd\u6570<\/p>\n<\/p>\n<p><p>sys.exit() \u662f Python \u6807\u51c6\u5e93\u4e2d\u63d0\u4f9b\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u7528\u4e8e\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4e3b\u52a8\u9000\u51fa\u3002\u8be5\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6574\u6570\u53c2\u6570\u4f5c\u4e3a\u9000\u51fa\u72b6\u6001\u7801\uff080 \u8868\u793a\u6b63\u5e38\u9000\u51fa\uff0c\u975e\u96f6\u8868\u793a\u5f02\u5e38\u9000\u51fa\uff09\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u4f20\u53c2\u6570\u3002\u8c03\u7528 sys.exit() \u51fd\u6570\u4f1a\u629b\u51fa\u4e00\u4e2a SystemExit \u5f02\u5e38\uff0c\u4ece\u800c\u7ec8\u6b62\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    print(&quot;\u7a0b\u5e8f\u5f00\u59cb\u8fd0\u884c&quot;)<\/p>\n<p>    # \u67d0\u79cd\u6761\u4ef6\u4e0b\u9700\u8981\u9000\u51fa\u7a0b\u5e8f<\/p>\n<p>    sys.exit(&quot;\u7a0b\u5e8f\u5df2\u6b63\u5e38\u9000\u51fa&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528 os._exit() \u51fd\u6570<\/p>\n<\/p>\n<p><p>os._exit() \u51fd\u6570\u4e0e sys.exit() \u7c7b\u4f3c\uff0c\u4f46\u5b83\u76f4\u63a5\u7ec8\u6b62\u8fdb\u7a0b\u800c\u4e0d\u629b\u51fa\u5f02\u5e38\u3002os._exit() \u901a\u5e38\u7528\u4e8e\u591a\u7ebf\u7a0b\u7a0b\u5e8f\u4e2d\uff0c\u5728\u5b50\u7ebf\u7a0b\u4e2d\u8c03\u7528\u4ee5\u7ec8\u6b62\u6574\u4e2a\u8fdb\u7a0b\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cos._exit() \u4f1a\u7acb\u5373\u7ec8\u6b62\u7a0b\u5e8f\uff0c\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u7684\u6e05\u7406\u64cd\u4f5c\uff0c\u56e0\u6b64\u5e94\u8c28\u614e\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>def main():<\/p>\n<p>    print(&quot;\u5f00\u59cb\u6267\u884c\u7a0b\u5e8f&quot;)<\/p>\n<p>    # \u5728\u67d0\u79cd\u6761\u4ef6\u4e0b\u76f4\u63a5\u9000\u51fa\u8fdb\u7a0b<\/p>\n<p>    os._exit(0)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u901a\u8fc7\u8bbe\u7f6e\u6807\u5fd7\u53d8\u91cf\u63a7\u5236\u5faa\u73af<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u9700\u8981\u5728\u7279\u5b9a\u6761\u4ef6\u4e0b\u7ed3\u675f\u5faa\u73af\u5e76\u9000\u51fa\u7a0b\u5e8f\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u4f7f\u7528\u6807\u5fd7\u53d8\u91cf\u3002\u6807\u5fd7\u53d8\u91cf\u662f\u4e00\u79cd\u7b80\u5355\u800c\u6709\u6548\u7684\u63a7\u5236\u5faa\u73af\u8fd0\u884c\u72b6\u6001\u7684\u65b9\u5f0f\u3002\u901a\u8fc7\u8bbe\u7f6e\u4e00\u4e2a\u5e03\u5c14\u53d8\u91cf\uff0c\u7a0b\u5e8f\u53ef\u4ee5\u5728\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6\u65f6\u5c06\u5176\u7f6e\u4e3a False\uff0c\u4ece\u800c\u9000\u51fa\u5faa\u73af\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def main():<\/p>\n<p>    running = True<\/p>\n<p>    while running:<\/p>\n<p>        # \u6a21\u62df\u67d0\u4e9b\u64cd\u4f5c<\/p>\n<p>        user_input = input(&quot;\u8f93\u5165 &#39;exit&#39; \u4ee5\u505c\u6b62\u7a0b\u5e8f\uff1a&quot;)<\/p>\n<p>        if user_input == &#39;exit&#39;:<\/p>\n<p>            running = False<\/p>\n<p>    print(&quot;\u7a0b\u5e8f\u5df2\u505c\u6b62&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528 raise \u8bed\u53e5\u629b\u51fa\u5f02\u5e38<\/p>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 raise \u8bed\u53e5\u663e\u5f0f\u5730\u629b\u51fa\u5f02\u5e38\uff0c\u4ee5\u6b64\u6765\u7ed3\u675f\u7a0b\u5e8f\u7684\u6267\u884c\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u5728\u51fd\u6570\u5185\u90e8\u9047\u5230\u67d0\u4e9b\u5f02\u5e38\u60c5\u51b5\u65f6\uff0c\u4e3b\u52a8\u7ec8\u6b62\u7a0b\u5e8f\u3002\u901a\u5e38\uff0c\u7a0b\u5e8f\u5458\u4f1a\u5b9a\u4e49\u81ea\u5b9a\u4e49\u5f02\u5e38\u6765\u66f4\u597d\u5730\u8868\u8fbe\u7a0b\u5e8f\u4e2d\u7684\u7279\u6b8a\u9000\u51fa\u6761\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class CustomExitException(Exception):<\/p>\n<p>    pass<\/p>\n<p>def some_function():<\/p>\n<p>    # \u5f53\u67d0\u79cd\u6761\u4ef6\u6ee1\u8db3\u65f6\u629b\u51fa\u5f02\u5e38<\/p>\n<p>    raise CustomExitException(&quot;\u7a0b\u5e8f\u9047\u5230\u81ea\u5b9a\u4e49\u9000\u51fa\u6761\u4ef6&quot;)<\/p>\n<p>def main():<\/p>\n<p>    try:<\/p>\n<p>        some_function()<\/p>\n<p>    except CustomExitException as e:<\/p>\n<p>        print(e)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001\u4f7f\u7528\u7ebf\u7a0b\u4e2d\u7684 stop() \u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u5e94\u7528\u4e2d\uff0c\u6709\u65f6\u9700\u8981\u505c\u6b62\u67d0\u4e2a\u7ebf\u7a0b\u7684\u6267\u884c\u3002\u867d\u7136 Python \u6807\u51c6\u5e93\u7684 threading.Thread \u7c7b\u6ca1\u6709\u63d0\u4f9b\u76f4\u63a5\u7684 stop() \u65b9\u6cd5\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e00\u4e2a\u6807\u5fd7\u53d8\u91cf\uff0c\u5728\u7ebf\u7a0b\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5b9a\u671f\u68c0\u67e5\u8be5\u53d8\u91cf\u7684\u503c\u6765\u5b9e\u73b0\u7ebf\u7a0b\u7684\u7ec8\u6b62\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>import time<\/p>\n<p>class StoppableThread(threading.Thread):<\/p>\n<p>    def __init__(self):<\/p>\n<p>        super().__init__()<\/p>\n<p>        self._stop_event = threading.Event()<\/p>\n<p>    def run(self):<\/p>\n<p>        while not self._stop_event.is_set():<\/p>\n<p>            print(&quot;\u7ebf\u7a0b\u6b63\u5728\u8fd0\u884c...&quot;)<\/p>\n<p>            time.sleep(1)<\/p>\n<p>    def stop(self):<\/p>\n<p>        self._stop_event.set()<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    thread = StoppableThread()<\/p>\n<p>    thread.start()<\/p>\n<p>    time.sleep(5)<\/p>\n<p>    thread.stop()<\/p>\n<p>    thread.join()<\/p>\n<p>    print(&quot;\u7ebf\u7a0b\u5df2\u505c\u6b62&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e03\u3001\u4f7f\u7528 asyncio \u7684\u53d6\u6d88\u4efb\u52a1<\/p>\n<\/p>\n<p><p>\u5728\u5f02\u6b65\u7f16\u7a0b\u4e2d\uff0c\u5c24\u5176\u662f\u4f7f\u7528 asyncio \u5e93\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u53d6\u6d88\u4efb\u52a1\u6765\u7ec8\u6b62\u5f02\u6b65\u64cd\u4f5c\u3002asyncio \u63d0\u4f9b\u4e86 cancel() \u65b9\u6cd5\uff0c\u53ef\u4ee5\u7528\u4e8e\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u4efb\u52a1\u3002\u88ab\u53d6\u6d88\u7684\u4efb\u52a1\u4f1a\u629b\u51fa\u4e00\u4e2a asyncio.CancelledError \u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import asyncio<\/p>\n<p>async def some_async_task():<\/p>\n<p>    try:<\/p>\n<p>        while True:<\/p>\n<p>            print(&quot;\u5f02\u6b65\u4efb\u52a1\u6b63\u5728\u8fd0\u884c...&quot;)<\/p>\n<p>            await asyncio.sleep(1)<\/p>\n<p>    except asyncio.CancelledError:<\/p>\n<p>        print(&quot;\u5f02\u6b65\u4efb\u52a1\u5df2\u53d6\u6d88&quot;)<\/p>\n<p>async def main():<\/p>\n<p>    task = asyncio.create_task(some_async_task())<\/p>\n<p>    await asyncio.sleep(5)<\/p>\n<p>    task.cancel()<\/p>\n<p>    await task<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    asyncio.run(main())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u603b\u7ed3\uff1a<\/p>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u505c\u6b62\u7a0b\u5e8f\u8fd0\u884c\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u3002\u4f8b\u5982\uff0c\u952e\u76d8\u4e2d\u65ad\u9002\u7528\u4e8e\u7b80\u5355\u7684\u547d\u4ee4\u884c\u7a0b\u5e8f\uff0csys.exit() \u548c os._exit() \u51fd\u6570\u9002\u7528\u4e8e\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u4e3b\u52a8\u9000\u51fa\u7684\u573a\u666f\uff0c\u800c\u6807\u5fd7\u53d8\u91cf\u548c\u81ea\u5b9a\u4e49\u5f02\u5e38\u5219\u63d0\u4f9b\u4e86\u66f4\u7075\u6d3b\u7684\u63a7\u5236\u7a0b\u5e8f\u6267\u884c\u7684\u65b9\u5f0f\u3002\u5728\u591a\u7ebf\u7a0b\u548c\u5f02\u6b65\u7f16\u7a0b\u4e2d\uff0c\u4f7f\u7528\u6807\u5fd7\u53d8\u91cf\u3001\u7ebf\u7a0b\u505c\u6b62\u65b9\u6cd5\u3001\u4ee5\u53ca\u5f02\u6b65\u4efb\u52a1\u53d6\u6d88\u90fd\u662f\u6709\u6548\u7684\u9009\u62e9\u3002\u7406\u89e3\u8fd9\u4e9b\u65b9\u6cd5\u7684\u9002\u7528\u573a\u666f\u53ca\u5176\u5c40\u9650\u6027\uff0c\u6709\u52a9\u4e8e\u7f16\u5199\u51fa\u66f4\u5065\u58ee\u548c\u53ef\u7ef4\u62a4\u7684 Python \u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u5168\u5730\u505c\u6b62\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b89\u5168\u505c\u6b62\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u952e\u76d8\u4e0a\u7684\u4e2d\u65ad\u4fe1\u53f7\uff0c\u901a\u5e38\u662fCtrl+C\u3002\u8fd9\u4f1a\u5f15\u53d1\u4e00\u4e2aKeyboardInterrupt\u5f02\u5e38\uff0c\u7a0b\u5e8f\u53ef\u4ee5\u6355\u83b7\u5e76\u8fdb\u884c\u9002\u5f53\u7684\u6e05\u7406\u64cd\u4f5c\u3002\u6b64\u5916\uff0c\u5982\u679c\u5728\u4f7f\u7528IDLE\u6216\u67d0\u4e9bIDE\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5173\u95ed\u7a97\u53e3\u6216\u505c\u6b62\u6309\u94ae\u6765\u505c\u6b62\u7a0b\u5e8f\u8fd0\u884c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u662f\u5426\u53ef\u4ee5\u8bbe\u7f6e\u8d85\u65f6\u6765\u81ea\u52a8\u505c\u6b62\u7a0b\u5e8f\uff1f<\/strong><br \/>\u662f\u7684\uff0cPython\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>signal<\/code>\u6a21\u5757\u6216\u5728\u591a\u7ebf\u7a0b\/\u591a\u8fdb\u7a0b\u60c5\u51b5\u4e0b\u8bbe\u7f6e\u8d85\u65f6\u6765\u5b9e\u73b0\u81ea\u52a8\u505c\u6b62\u3002\u901a\u8fc7\u8bbe\u7f6e\u5b9a\u65f6\u5668\uff0c\u53ef\u4ee5\u5728\u6307\u5b9a\u65f6\u95f4\u540e\u629b\u51fa\u5f02\u5e38\uff0c\u5f3a\u5236\u505c\u6b62\u7a0b\u5e8f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u65f6\uff0c\u786e\u4fdd\u5904\u7406\u597d\u8d44\u6e90\u7684\u6e05\u7406\uff0c\u4ee5\u907f\u514d\u6570\u636e\u635f\u574f\u6216\u5176\u4ed6\u95ee\u9898\u3002<\/p>\n<p><strong>\u5982\u679cPython\u7a0b\u5e8f\u8fdb\u5165\u6b7b\u5faa\u73af\uff0c\u5982\u4f55\u5e94\u5bf9\uff1f<\/strong><br \/>\u5f53Python\u7a0b\u5e8f\u56e0\u6b7b\u5faa\u73af\u800c\u65e0\u6cd5\u505c\u6b62\u65f6\uff0c\u4f7f\u7528Ctrl+C\u901a\u5e38\u80fd\u591f\u4e2d\u65ad\u7a0b\u5e8f\u3002\u5982\u679c\u6b64\u65b9\u6cd5\u65e0\u6548\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u4efb\u52a1\u7ba1\u7406\u5668\u4e2d\u5f3a\u5236\u7ed3\u675f\u8be5\u8fdb\u7a0b\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>kill<\/code>\u547d\u4ee4\u6765\u7ed3\u675f\u8fdb\u7a0b\u3002\u5728\u5904\u7406\u6b7b\u5faa\u73af\u65f6\uff0c\u5efa\u8bae\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u9002\u5f53\u7684\u9000\u51fa\u6761\u4ef6\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u7ba1\u7406\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u505c\u6b62\u8fd0\u884c\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528\u952e\u76d8\u4e2d\u65ad\u3001sys.exit()\u51fd\u6570\u3001os._e [&hellip;]","protected":false},"author":3,"featured_media":987372,"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\/987367"}],"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=987367"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987367\/revisions"}],"predecessor-version":[{"id":987376,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987367\/revisions\/987376"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/987372"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=987367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=987367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=987367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}