{"id":963443,"date":"2024-12-27T04:18:06","date_gmt":"2024-12-26T20:18:06","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/963443.html"},"modified":"2024-12-27T04:18:08","modified_gmt":"2024-12-26T20:18:08","slug":"python%e5%a6%82%e4%bd%95%e4%be%9d%e6%8d%aesh%e8%be%93%e5%85%a5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/963443.html","title":{"rendered":"python\u5982\u4f55\u4f9d\u636esh\u8f93\u5165"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24180733\/f70b6dcc-a81e-4b0f-a14d-008c1e80a3a8.webp\" alt=\"python\u5982\u4f55\u4f9d\u636esh\u8f93\u5165\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u4f9d\u636eShell\uff08sh\uff09\u8f93\u5165\u6765\u6267\u884c\u547d\u4ee4\u5e76\u5904\u7406\u7ed3\u679c\u3002<strong>\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u3001<code>os<\/code>\u6a21\u5757\u3001\u4ee5\u53ca<code>sh<\/code>\u5e93\u7b49\u3002<\/strong>\u5176\u4e2d\uff0c<code>subprocess<\/code>\u6a21\u5757\u662f\u6700\u4e3a\u63a8\u8350\u548c\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u63a5\u53e3\u6765\u542f\u52a8\u548c\u4e0e\u5b50\u8fdb\u7a0b\u8fdb\u884c\u901a\u4fe1\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757<\/p>\n<\/p>\n<p><p><code>subprocess<\/code>\u6a21\u5757\u5141\u8bb8\u4f60\u751f\u6210\u65b0\u7684\u8fdb\u7a0b\u3001\u8fde\u63a5\u5b83\u4eec\u7684\u8f93\u5165\/\u8f93\u51fa\/\u9519\u8bef\u7ba1\u9053\uff0c\u4ee5\u53ca\u83b7\u53d6\u5b83\u4eec\u7684\u8fd4\u56de\u503c\u3002\u5b83\u63d0\u4f9b\u4e86\u6bd4<code>os.system<\/code>\u66f4\u5f3a\u5927\u548c\u7075\u6d3b\u7684\u65b9\u5f0f\u6765\u6267\u884cshell\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h3>1. \u4f7f\u7528<code>subprocess.run()<\/code><\/h3>\n<\/p>\n<p><p><code>subprocess.run()<\/code>\u662fPython 3.5\u4e2d\u5f15\u5165\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u7528\u4e8e\u8fd0\u884c\u547d\u4ee4\u5e76\u7b49\u5f85\u547d\u4ee4\u5b8c\u6210\u3002\u5b83\u8fd4\u56de\u4e00\u4e2a<code>CompletedProcess<\/code>\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>def run_command(command):<\/p>\n<p>    result = subprocess.run(command, shell=True, text=True, capture_output=True)<\/p>\n<p>    if result.returncode == 0:<\/p>\n<p>        print(&quot;Command succeeded:&quot;, result.stdout)<\/p>\n<p>    else:<\/p>\n<p>        print(&quot;Command f<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>led with error:&quot;, result.stderr)<\/p>\n<p>run_command(&quot;ls -l&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>shell=True<\/code>\u5141\u8bb8\u547d\u4ee4\u901a\u8fc7shell\u6267\u884c\uff0c<code>text=True<\/code>\u5c06\u8f93\u51fa\u4f5c\u4e3a\u5b57\u7b26\u4e32\u5904\u7406\uff0c<code>capture_output=True<\/code>\u5219\u6355\u83b7\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h3>2. \u4f7f\u7528<code>subprocess.Popen()<\/code><\/h3>\n<\/p>\n<p><p><code>subprocess.Popen()<\/code>\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\uff0c\u5141\u8bb8\u4f60\u76f4\u63a5\u4e0e\u5b50\u8fdb\u7a0b\u4ea4\u4e92\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>def execute_command(command):<\/p>\n<p>    process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)<\/p>\n<p>    stdout, stderr = process.communicate()<\/p>\n<p>    if process.returncode == 0:<\/p>\n<p>        print(&quot;Output:&quot;, stdout)<\/p>\n<p>    else:<\/p>\n<p>        print(&quot;Error:&quot;, stderr)<\/p>\n<p>execute_command(&quot;ls -l&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>Popen<\/code>\u5bf9\u8c61\u5141\u8bb8\u6211\u4eec\u5728\u547d\u4ee4\u6267\u884c\u65f6\u8fdb\u884c\u4ea4\u4e92\uff0c\u6bd4\u5982\u5411\u8fdb\u7a0b\u53d1\u9001\u8f93\u5165\u6216\u5b9e\u65f6\u8bfb\u53d6\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528<code>os<\/code>\u6a21\u5757<\/p>\n<\/p>\n<p><p><code>os<\/code>\u6a21\u5757\u662fPython\u4e2d\u7528\u4e8e\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u4ea4\u4e92\u7684\u6a21\u5757\u4e4b\u4e00\u3002\u5c3d\u7ba1<code>os.system()<\/code>\u5df2\u7ecf\u4e0d\u518d\u63a8\u8350\u4f7f\u7528\uff0c\u4f46\u4e86\u89e3\u5176\u7528\u6cd5\u4f9d\u7136\u6709\u610f\u4e49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>def system_command(command):<\/p>\n<p>    exit_code = os.system(command)<\/p>\n<p>    if exit_code == 0:<\/p>\n<p>        print(&quot;Command executed successfully&quot;)<\/p>\n<p>    else:<\/p>\n<p>        print(&quot;Command failed&quot;)<\/p>\n<p>system_command(&quot;ls -l&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>os.system()<\/code>\u7684\u7f3a\u70b9\u662f\u65e0\u6cd5\u6355\u83b7\u547d\u4ee4\u7684\u8f93\u51fa\uff0c\u4e14\u5b89\u5168\u6027\u8f83\u4f4e\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528<code>sh<\/code>\u5e93<\/p>\n<\/p>\n<p><p><code>sh<\/code>\u5e93\u662fPython\u7684\u4e00\u4e2a\u7b2c\u4e09\u65b9\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3aPythonic\u7684\u65b9\u5f0f\u6765\u6267\u884cShell\u547d\u4ee4\u3002\u5b83\u7684\u4f7f\u7528\u65b9\u6cd5\u975e\u5e38\u7b80\u6d01\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sh<\/p>\n<p>def sh_command(command):<\/p>\n<p>    try:<\/p>\n<p>        output = sh.ls(&quot;-l&quot;)<\/p>\n<p>        print(&quot;Command output:&quot;, output)<\/p>\n<p>    except sh.ErrorReturnCode as e:<\/p>\n<p>        print(&quot;Error:&quot;, e)<\/p>\n<p>sh_command(&quot;ls -l&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>sh<\/code>\u5e93\u7684\u597d\u5904\u662f\u547d\u4ee4\u6267\u884c\u7684\u8bed\u6cd5\u4e0eShell\u975e\u5e38\u63a5\u8fd1\uff0c\u4e14\u80fd\u591f\u8f7b\u677e\u5904\u7406\u547d\u4ee4\u7684\u8f93\u5165\u548c\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001Python Shell\u811a\u672c\u4e0e\u5916\u90e8\u8f93\u5165\u7684\u96c6\u6210<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528Python\u4ee3\u7801\u76f4\u63a5\u6267\u884cshell\u547d\u4ee4\uff0cPython\u811a\u672c\u672c\u8eab\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5916\u90e8\u8f93\u5165\u96c6\u6210\u5230\u66f4\u5927\u7684Shell\u811a\u672c\u4e2d\u3002\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u4f20\u9012\u3001\u6587\u4ef6\u8f93\u5165\u8f93\u51fa\u7b49\u65b9\u5f0f\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h3>1. \u4f7f\u7528<code>argparse<\/code>\u83b7\u53d6Shell\u8f93\u5165<\/h3>\n<\/p>\n<p><p><code>argparse<\/code>\u6a21\u5757\u5141\u8bb8Python\u811a\u672c\u63a5\u6536\u6765\u81eaShell\u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import argparse<\/p>\n<p>def main():<\/p>\n<p>    parser = argparse.ArgumentParser(description=&quot;Process some integers.&quot;)<\/p>\n<p>    parser.add_argument(&quot;command&quot;, type=str, help=&quot;Command to execute&quot;)<\/p>\n<p>    args = parser.parse_args()<\/p>\n<p>    run_command(args.command)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728Shell\u4e2d\u8fd0\u884cPython\u811a\u672c\u5e76\u4f20\u9012\u547d\u4ee4\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><h3>2. \u901a\u8fc7\u6587\u4ef6\u8fdb\u884c\u8f93\u5165\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>Python\u811a\u672c\u53ef\u4ee5\u4e0eShell\u901a\u8fc7\u6587\u4ef6\u8fdb\u884c\u4ea4\u4e92\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u5904\u7406\u5927\u91cf\u6570\u636e\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def read_file(filename):<\/p>\n<p>    with open(filename, &#39;r&#39;) as file:<\/p>\n<p>        data = file.read()<\/p>\n<p>        print(data)<\/p>\n<p>def write_file(filename, content):<\/p>\n<p>    with open(filename, &#39;w&#39;) as file:<\/p>\n<p>        file.write(content)<\/p>\n<h2><strong>\u4f7f\u7528Shell\u91cd\u5b9a\u5411\u8fdb\u884c\u6587\u4ef6\u8f93\u5165\u8f93\u51fa<\/strong><\/h2>\n<h2><strong>python script.py &lt; input.txt &gt; output.txt<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u901a\u8fc7Python\u4e0eShell\u7684\u8054\u5408\u4f7f\u7528\u5b9e\u73b0\u590d\u6742\u4efb\u52a1<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0cPython\u4e0eShell\u5e38\u5e38\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u53d1\u6325\u5404\u81ea\u7684\u4f18\u52bf\u3002\u4f8b\u5982\uff0c\u4f7f\u7528Shell\u8fdb\u884c\u7cfb\u7edf\u7ea7\u4efb\u52a1\uff08\u5982\u6587\u4ef6\u64cd\u4f5c\u3001\u8c03\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff09\uff0c\u800c\u4f7f\u7528Python\u8fdb\u884c\u6570\u636e\u5904\u7406\u548c\u903b\u8f91\u63a7\u5236\u3002<\/p>\n<\/p>\n<p><h3>1. \u81ea\u52a8\u5316\u4efb\u52a1<\/h3>\n<\/p>\n<p><p>Python\u811a\u672c\u53ef\u4ee5\u7528\u4e8e\u81ea\u52a8\u5316Shell\u547d\u4ee4\u7684\u6267\u884c\uff0c\u4f8b\u5982\u5b9a\u671f\u5907\u4efd\u3001\u65e5\u5fd7\u5206\u6790\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>import time<\/p>\n<p>def backup_files():<\/p>\n<p>    while True:<\/p>\n<p>        subprocess.run(&quot;tar -czf backup.tar.gz \/path\/to\/directory&quot;, shell=True)<\/p>\n<p>        time.sleep(86400)  # \u6bcf24\u5c0f\u65f6\u6267\u884c\u4e00\u6b21<\/p>\n<p>backup_files()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u6570\u636e\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728Shell\u4e2d\u8c03\u7528Python\u811a\u672c\u8fdb\u884c\u590d\u6742\u7684\u6570\u636e\u5904\u7406\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">#!\/bin\/bash<\/p>\n<h2><strong>Shell\u811a\u672c\u8c03\u7528Python\u5904\u7406\u6570\u636e<\/strong><\/h2>\n<p>output=$(python3 process_data.py &lt; data.txt)<\/p>\n<p>echo &quot;Processed Data: $output&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u7cfb\u7edf\u76d1\u63a7<\/h3>\n<\/p>\n<p><p>\u7ed3\u5408\u4f7f\u7528Shell\u547d\u4ee4\u548cPython\u811a\u672c\u8fdb\u884c\u7cfb\u7edf\u76d1\u63a7\u548c\u8b66\u62a5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>def check_disk_usage():<\/p>\n<p>    result = subprocess.run(&quot;df -h&quot;, shell=True, text=True, capture_output=True)<\/p>\n<p>    if &quot;100%&quot; in result.stdout:<\/p>\n<p>        print(&quot;Disk is full!&quot;)<\/p>\n<p>check_disk_usage()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u603b\u7ed3\uff1a<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\u4f9d\u636eShell\u8f93\u5165\u6267\u884c\u547d\u4ee4\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec<strong><code>subprocess<\/code>\u6a21\u5757\u3001<code>os<\/code>\u6a21\u5757\u3001<code>sh<\/code>\u5e93\u7b49<\/strong>\u3002\u5728\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0c<code>subprocess<\/code>\u6a21\u5757\u662f\u6700\u4e3a\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u548c\u66f4\u597d\u7684\u5b89\u5168\u6027\u3002\u6b64\u5916\uff0cPython\u811a\u672c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u3001\u6587\u4ef6\u7b49\u65b9\u5f0f\u4e0eShell\u8fdb\u884c\u4ea4\u4e92\uff0c\u9002\u7528\u4e8e\u81ea\u52a8\u5316\u4efb\u52a1\u3001\u6570\u636e\u5904\u7406\u3001\u7cfb\u7edf\u76d1\u63a7\u7b49\u590d\u6742\u573a\u666f\u3002\u901a\u8fc7\u5408\u7406\u9009\u62e9\u548c\u7ec4\u5408\u8fd9\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u6781\u5927\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u811a\u672c\u7684\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u63a5\u6536Shell\u811a\u672c\u7684\u8f93\u5165\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u6765\u6267\u884cShell\u547d\u4ee4\u5e76\u63a5\u6536\u5176\u8f93\u51fa\u3002\u901a\u8fc7<code>subprocess.run()<\/code>\u6216<code>subprocess.Popen()<\/code>\u53ef\u4ee5\u5b9e\u73b0\u4e0eShell\u7684\u4ea4\u4e92\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u9700\u8981\u7684\u590d\u6742\u6027\u3002\u5982\u679c\u53ea\u9700\u7b80\u5355\u8f93\u51fa\uff0c\u53ef\u4ee5\u4f7f\u7528<code>check_output()<\/code>\u83b7\u53d6\u7ed3\u679c\u3002<\/p>\n<p><strong>Python\u4e2d\u5982\u4f55\u5904\u7406Shell\u547d\u4ee4\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u5904\u7406Shell\u547d\u4ee4\u65f6\uff0c\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u53ef\u4ee5\u6355\u83b7\u9519\u8bef\u3002\u901a\u8fc7\u8bbe\u7f6e<code>check=True<\/code>\u53c2\u6570\uff0cPython\u4f1a\u5728Shell\u547d\u4ee4\u8fd4\u56de\u975e\u96f6\u72b6\u6001\u65f6\u629b\u51fa\u5f02\u5e38\u3002\u6355\u83b7<code>subprocess.CalledProcessError<\/code>\u53ef\u4ee5\u8ba9\u4f60\u66f4\u597d\u5730\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\uff0c\u6267\u884c\u81ea\u5b9a\u4e49\u7684\u9519\u8bef\u5904\u7406\u903b\u8f91\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5c06Shell\u547d\u4ee4\u7684\u8f93\u51fa\u5b58\u50a8\u5230\u53d8\u91cf\u4e2d\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7<code>subprocess.run()<\/code>\u6216<code>subprocess.check_output()<\/code>\u5c06Shell\u547d\u4ee4\u7684\u8f93\u51fa\u76f4\u63a5\u5b58\u50a8\u5230Python\u53d8\u91cf\u4e2d\u3002\u4f7f\u7528<code>stdout=subprocess.PIPE<\/code>\u53c2\u6570\u53ef\u4ee5\u83b7\u53d6\u547d\u4ee4\u8f93\u51fa\uff0c\u800c\u540e\u901a\u8fc7<code>result.stdout<\/code>\u8bbf\u95ee\u8be5\u8f93\u51fa\uff0c\u786e\u4fdd\u5bf9\u8f93\u51fa\u8fdb\u884c\u9002\u5f53\u7684\u89e3\u7801\u4ee5\u4fbf\u4e8e\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u4f9d\u636eShell\uff08sh\uff09\u8f93\u5165\u6765\u6267\u884c\u547d\u4ee4\u5e76\u5904\u7406\u7ed3\u679c\u3002\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528subpro [&hellip;]","protected":false},"author":3,"featured_media":963454,"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\/963443"}],"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=963443"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/963443\/revisions"}],"predecessor-version":[{"id":963457,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/963443\/revisions\/963457"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/963454"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=963443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=963443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=963443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}