{"id":1050,"date":"2018-06-13T11:36:22","date_gmt":"2018-06-13T11:36:22","guid":{"rendered":"https:\/\/www.ipcpu.com\/?p=1050"},"modified":"2018-08-13T11:37:59","modified_gmt":"2018-08-13T11:37:59","slug":"python-os-system-subprocess","status":"publish","type":"post","link":"https:\/\/c.ipcpu.com\/2018\/06\/python-os-system-subprocess\/","title":{"rendered":"Python\u4e4b\u7cfb\u7edf\u4ea4\u4e92(\u8c03\u7528\u7cfb\u7edf\u547d\u4ee4)subprocess"},"content":{"rendered":"

\u5728\u65e9\u671f\u7684Python\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u4e3b\u8981\u662f\u901a\u8fc7os.system()\u3001os.popen().read()\u7b49\u51fd\u6570\u6765\u6267\u884c\u547d\u4ee4\u884c\u6307\u4ee4\u7684\uff0c\u53e6\u5916\u8fd8\u6709\u4e00\u4e2a\u5f88\u5c11\u4f7f\u7528\u7684commands\u6a21\u5757\u3002\u4f46\u662f\u4ecePython 2.4\u5f00\u59cb\u5b98\u65b9\u6587\u6863\u4e2d\u5efa\u8bae\u4f7f\u7528\u7684\u662fsubprocess\u6a21\u5757\u3002\uff08\u672c\u6587\u7684\u4f8b\u5b50\u5168\u90e8\u662f\u4ee5Python3.5\u4e3a\u8fd0\u884c\u73af\u5883\uff09<\/p>\n

\u5bf9\u4e8e\u8c03\u7528\u4e00\u4e2a\u7cfb\u7edf\u547d\u4ee4\uff0c\u6211\u4eec\u6700\u5173\u5fc3\u7684\u6709\u5982\u4e0b\u51e0\u70b9\uff1a<\/p>\n

\n
    \n
  1. \u547d\u4ee4\u6267\u884c\u7684\u72b6\u6001\u7801--\u8868\u793a\u547d\u4ee4\u6267\u884c\u662f\u5426\u6210\u529f<\/li>\n
  2. \u547d\u4ee4\u6267\u884c\u7684\u8f93\u51fa\u7ed3\u679c--\u547d\u4ee4\u6267\u884c\u6210\u529f\u540e\u6216\u8005\u9519\u8bef\u540e\u7684\u8f93\u51fa<\/li>\n<\/ol>\n<\/blockquote>\n

    \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5206\u522b\u770b\u4e0b\u8fd9\u51e0\u79cd\u65b9\u6cd5\u3002<\/p>\n

    \u4e00\u3001os.system()\u548cos.popen()\u7684\u7528\u6cd5<\/h2>\n

    \u6211\u4eec\u5148\u6765\u770b\u4e0bos.system()\u7684\u7528\u6cd5\uff1a<\/p>\n

    \n
    #!\/usr\/bin\/python\nimport os\n\nprint('--os.system-code0--')\nres = os.system('ls')\nprint(type(res))\nprint(res)\nprint('--os.system-codenot0-')\nres = os.system('lsa')\nprint(type(res))\nprint(res)<\/code><\/pre>\n<\/div>\n

    \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b<\/p>\n

    \n
    --os.system-code0--\naa.py anaconda-ks.cfg   debug.log original-ks.cfg\n<class 'int'>\n0\n--os.system-codenot0-\nsh: lsa: command not found\n<class 'int'>\n32512<\/code><\/pre>\n<\/div>\n

    \u7ed3\u8bba\uff1aos.system(command)\u4f1a\u8fd4\u56de\u547d\u4ee4\u6267\u884c\u7684\u8fd4\u56de\u7801\uff0c\u800c\u5c06\u547d\u4ee4\u6267\u884c\u7ed3\u679c\u8f93\u51fa\u5230\u5c4f\u5e55\u3002<\/strong><\/p>\n

    os.popen()\u7684\u4ee3\u7801\u5982\u4e0b<\/p>\n

    \n
    print('--os.popen--')\nres = os.popen('ls')\nprint(type(res))\nprint(res.read())<\/code><\/pre>\n<\/div>\n

    \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b<\/p>\n

    \n
    --os.popen--\n<class 'os._wrap_close'>\naa.py\nanaconda-ks.cfg\noriginal-ks.cfg<\/code><\/pre>\n<\/div>\n

    \u7ed3\u8bba\uff1aos.popen(command).read()\u53ef\u4ee5\u83b7\u53d6\u547d\u4ee4\u6267\u884c\u7ed3\u679c\uff0c\u4f46\u662f\u65e0\u6cd5\u83b7\u53d6\u547d\u4ee4\u6267\u884c\u7684\u8fd4\u56de\u7801\u3002<\/strong>
    \n\u8fd9\u4e24\u4e2a\u547d\u4ee4\uff0c\u90fd\u529f\u80fd\u4e0d\u5168\u5462\uff1f\u6709\u6ca1\u6709\u65e2\u80fd\u62ff\u5230\u8fd4\u56de\u7801\uff0c\u53c8\u80fd\u62ff\u5230\u8f93\u51fa\u7ed3\u679c\u7684\u5462\uff1f\u6709\u3002<\/p>\n

    \u4e8c\u3001subprocess.run\u7684\u7528\u6cd5<\/h2>\n

    subprocess\u662fPython 2.4\u4e2d\u65b0\u589e\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u5141\u8bb8\u4f60\u751f\u6210\u65b0\u7684\u8fdb\u7a0b\uff0c\u8fde\u63a5\u5230\u5b83\u4eec\u7684 input\/output\/error \u7ba1\u9053\uff0c\u5e76\u83b7\u53d6\u5b83\u4eec\u7684\u8fd4\u56de\uff08\u72b6\u6001\uff09\u7801\u3002
    \n\u5728Python 3.5\u4e4b\u540e\u7684\u7248\u672c\u4e2d\uff0c\u5b98\u65b9\u6587\u6863\u4e2d\u63d0\u5021\u901a\u8fc7subprocess.run()\u51fd\u6570\u66ff\u4ee3\u5176\u4ed6\u51fd\u6570\u6765\u4f7f\u7528subproccess\u6a21\u5757\u7684\u529f\u80fd\uff1b
    \n\u5728Python 3.5\u4e4b\u524d\u7684\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7subprocess.call()\uff0csubprocess.getoutput()\u7b49\u4e0a\u9762\u5217\u51fa\u7684\u5176\u4ed6\u51fd\u6570\u6765\u4f7f\u7528subprocess\u6a21\u5757\u7684\u529f\u80fd\uff1b <\/p>\n

    \n
    #!\/usr\/bin\/python\nimport subprocess\n\nprint('--subprocess.run--')\nres = subprocess.run([\"ls\", \"-l\"],stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)\nprint(type(res))\nprint(res)\nprint('code: ',res.returncode,'stdout: ',res.stdout)<\/code><\/pre>\n<\/div>\n

    \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b<\/p>\n

    \n
    --subprocess.run--\n<class 'subprocess.CompletedProcess'>\nCompletedProcess(args='ls', returncode=0, stdout=b'aa.py\\nanaconda-ks.cfg\\nbb.py\\ndebug.log\\noriginal-ks.cfg\\n', stderr=b'')\ncode: 0 stdout: b'aa.py\\nanaconda-ks.cfg\\nbb.py\\ndebug.log\\noriginal-ks.cfg\\n'<\/code><\/pre>\n<\/div>\n

    subprocess.run()\u8fd4\u56de\u4e86\u4e00\u4e2a\u7c7b\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u7a0b\u5e8f\u8fd0\u884c\u8fd4\u56de\u7801\uff0c\u548c\u8f93\u51fa\u5185\u5bb9\u3002<\/strong>
    \n\u6ce8\u610f\uff1a\u5982\u679c\u52a0\u4e0a\u4e86check=True\u53c2\u6570\uff0c\u8868\u793a\u547d\u4ee4\u6267\u884c\u5931\u8d25\u4f1a\u629b\u51fa\u5f02\u5e38\u3002<\/p>\n

    2.1 \u5173\u4e8e\u8f93\u51fa<\/h4>\n

    \u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u4e0a\u9762\u8f93\u51fa\u7684\u7ed3\u679c\u662f b'xxxxx'\uff0c\u8fd9\u662f\u4e00\u4e2abytes\u7c7b\u578b\u7684\u6570\u636e\u3002\u5b9e\u9645\u4f7f\u7528\u4e2d\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u683c\u5f0f\u3002<\/p>\n

    \n
    #linux\u4f7f\u7528\u81ea\u52a8\uff0c\u6216\u8005uft8\nprint(res.stdout.decode())\n#windows\u4e0b\u5b57\u7b26\u7f16\u7801\u662fGB2312\nprint(res.stdout.decode('GB2312'))<\/code><\/pre>\n<\/div>\n

    2.2 \u8f93\u51fa\u5230HTML\u65f6\u4fdd\u7559\u6362\u884c<\/h4>\n

    \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5c06\u5e26\u6709\u6362\u884c\u7684\u6570\u636e\u5b57\u7b26\u4e32\u8f93\u51fa\u5230HTML\u4e2d\uff0c\u5b57\u7b26\u4e32\u4f1a\u53d8\u6210\u4e00\u884c\uff0c\u6ca1\u6709\u6362\u884c\uff0c\u5982\u679c\u60f3\u4fdd\u7559\u539f\u5b57\u7b26\u4e32\u7684\u6362\u884c\u683c\u5f0f\uff0c\u9700\u8981\u4f7f\u7528HTML\u6807\u7b7e<\/p>\n

    <\/pre>\n

    \uff0c\u4f8b\u5982<\/p>\n

    \n
    <div class=\"box-body\">\n<pre> {{ content }} <\/pre>\n<\/div><\/code><\/pre>\n<\/div>\n

    2.3 \u5173\u4e8eshell\u53c2\u6570<\/h4>\n

    shell\u9ed8\u8ba4\u4e3aFalse\u3002<\/p>\n

    \n

    \u5728Linux\u4e0b\uff0cshell=False\u65f6, \u5982\u679cargs\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e48\u53ea\u80fd\u662f\u547d\u4ee4\uff0c\u4e0d\u80fd\u5305\u542b\u4efb\u4f55\u53c2\u6570\uff0c\u5426\u5219\u62a5\u9519\uff1b\u5982\u679cargs\u662f\u4e00\u4e2a\u5217\u8868list\uff0c\u5219args\u7684\u7b2c\u4e00\u9879\u662f\u5b9a\u4e49\u7a0b\u5e8f\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u5176\u5b83\u9879\u662f\u8c03\u7528\u7cfb\u7edfShell\u65f6\u7684\u9644\u52a0\u53c2\u6570\u3002<\/p>\n

    shell=True\u65f6\uff0c\u5982\u679cargs\u662f\u5b57\u7b26\u4e32\uff0cPopen\u76f4\u63a5\u8c03\u7528\u7cfb\u7edf\u7684Shell\u6765\u6267\u884c\uff0c\u5b57\u7b26\u4e32\u683c\u5f0f\u548cshell\u7ec8\u7aef\u4e66\u5199\u683c\u5f0f\u4e00\u6837\uff1b\u5982\u679cargs\u662f\u4e00\u4e2a\u5217\u8868list\uff0c\u5219args\u7684\u7b2c\u4e00\u9879\u662f\u5b9a\u4e49\u7a0b\u5e8f\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u5176\u5b83\u9879\u662f\u8c03\u7528\u7cfb\u7edfShell\u65f6\u7684\u9644\u52a0\u53c2\u6570\u3002\u5b98\u65b9\u63a8\u8350shell=True\u65f6\uff0c\u4f7f\u7528\u5b57\u7b26\u4e32\u65b9\u5f0f\u4f20\u9012\u53c2\u6570\u3002<\/p>\n<\/blockquote>\n

    \u5982\u679c\u60f3\u4f7f\u7528shell\u4e2d\u7684\u7ba1\u9053\uff0c\u91cd\u5b9a\u5411\uff0c\u6587\u4ef6\u901a\u914d\u7b26\uff0c\u73af\u5883\u53d8\u91cf\u7b49\u529f\u80fd\uff0c\u4f8b\u5982\"ifconfig |grep eth0 > mm\"\uff0c\u90a3\u4e48\u53ea\u80fd\u4f7f\u7528shell=True\uff0c\u5e76\u4e14\u4f7f\u7528\u5b57\u7b26\u4e32\u6765\u4f20\u9012\u3002<\/p>\n

    \u7efc\u4e0a\uff0cshell=True\u529f\u80fd\u6700\u5f3a\u5927\u7684\uff0c\u4f46\u56e0\u4e3a\u5f3a\u5927\u4e5f\u5b58\u5728\u5b89\u5168\u98ce\u9669\uff0c\u9700\u8981\u8c28\u614e\u7684\u5bf9\u5f85\u4f20\u9012\u7684\u53c2\u6570\u3002<\/p>\n

    2.4 \u5173\u4e8e\u8d85\u65f6<\/h4>\n

    \u5f88\u591a\u811a\u672c\u8fd0\u884c\u65f6\u4f1a\u5361\u4f4f\uff0c\u5bfc\u81f4\u8c03\u7528\u811a\u672c\u4e00\u76f4\u7b49\u5f85\uff0c\u8fd9\u5f88\u663e\u7136\u4e0d\u662f\u6211\u4eec\u60f3\u770b\u5230\u7684\uff0c\u56e0\u6b64\u6267\u884c\u547d\u4ee4\u7684\u8d85\u65f6Timeout\u8bbe\u7f6e\u5f88\u6709\u5fc5\u8981\u3002\u597d\u5728subprocess.run()\u63d0\u4f9b\u4e86timeout\u53c2\u6570\uff0c\u4f7f\u7528\u5982\u4e0b\uff1a<\/p>\n

    \n
    res = subprocess.run('\/bin\/bash \/tmp\/for.sh',stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True,timeout=30)<\/code><\/pre>\n<\/div>\n

    \u5982\u679c\u572830\u79d2\u5185\u65e0\u6cd5\u6267\u884c\u5b8c\u6bd5\uff0c\u4f1a\u7206\u51fa\u5f02\u5e38\u3002<\/p>\n

    \n
    subprocess.TimeoutExpired: Command '\/bin\/bash \/tmp\/for.sh' timed out after 30 seconds<\/code><\/pre>\n<\/div>\n

    \u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528try\u3001except\u6355\u6349\u8fd9\u4e2a\u5f02\u5e38<\/p>\n

    \n
    try:\n    res = subprocess.run('\/bin\/bash \/tmp\/for.sh',stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True,timeout=30)\n    print(type(res))\n    print(res)\n    print('code: ',res.returncode,'stdout: ',res.stdout)\nexcept subprocess.TimeoutExpired as e:\n    print(e)<\/code><\/pre>\n<\/div>\n

    \u4e09\u3001subprocess.call\u548csubprocess.getoutput\u7528\u6cd5<\/h2>\n
    \n
    print('--subprocess.call--')\np = subprocess.call('ifconfig | grep eth0', stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)\nprint(type(p))\nprint(p)\n#\u53ea\u80fd\u5f97\u5230\u8fd4\u56de\u7801\uff0c\u5f97\u4e0d\u5230\u8f93\u51fa\n\nprint('--subprocess.getoutput--')\np = subprocess.getoutput('ifconfig | grep eth0')\nprint(type(p))\nprint(p)\n#\u53ea\u80fd\u5f97\u5230\u8f93\u51fa<\/code><\/pre>\n<\/div>\n

    \u663e\u793a\u7ed3\u679c\uff1a<\/p>\n

    \n
    --subprocess.call--\n<class 'int'>\n0\n--subprocess.getoutput--\n<class 'str'>\neth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<\/code><\/pre>\n<\/div>\n

    subprocess.call()\u53ea\u80fd\u8fd4\u56de\u72b6\u6001\u7801\u3002subprocess.getoutput(cmd)\u53ea\u80fd\u8f93\u51fa\u547d\u4ee4\u7ed3\u679c\u3002<\/strong><\/p>\n

    \u56db\u3001subprocess.popen()\u7684\u4f7f\u7528<\/h2>\n

    \u5b9e\u9645\u4e0a\uff0c\u4e0a\u9762\u7684\u51e0\u4e2a\u51fd\u6570\u90fd\u662f\u57fa\u4e8ePopen()\u7684\u5c01\u88c5(wrapper)\u3002\u8fd9\u4e9b\u5c01\u88c5\u7684\u76ee\u7684\u5728\u4e8e\u8ba9\u6211\u4eec\u5bb9\u6613\u4f7f\u7528\u5b50\u8fdb\u7a0b\u3002\u5f53\u6211\u4eec\u60f3\u8981\u66f4\u4e2a\u6027\u5316\u6211\u4eec\u7684\u9700\u6c42\u7684\u65f6\u5019\uff0c\u5c31\u8981\u8f6c\u5411Popen\u7c7b\uff0c\u8be5\u7c7b\u751f\u6210\u7684\u5bf9\u8c61\u7528\u6765\u4ee3\u8868\u5b50\u8fdb\u7a0b\u3002<\/p>\n

    \n
    #!\/usr\/bin\/python\nimport subprocess\n\nprint('--subprocess.popen--')\np = subprocess.Popen('ifconfig | grep eth0', stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)\nprint(type(p))\nprint(p)\nreturncode=p.wait()\nprint(returncode)\n#popen\u53ea\u6709\u901a\u8fc7wait\u6216\u8005poll\u624d\u80fd\u83b7\u5f97\u8fd4\u56de\nprint(p.stdout.read())\nprint(p.stderr.read())<\/code><\/pre>\n<\/div>\n

    \u6267\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

    \n
    --subprocess.popen--\n<class 'subprocess.Popen'>\n<subprocess.Popen object at 0x7fd3160812e8>\n0\nb'eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500\\n'\nb''<\/code><\/pre>\n<\/div>\n

    \u53c2\u8003\u8d44\u6599<\/h2>\n

    https:\/\/www.cnblogs.com\/yyds\/p\/7288916.html<\/a><\/p>\n

    <\/p>\n

    <\/div>\n
    <\/div>\n
    \n
    <\/div>\n
    <\/div>\n
    <\/div>\n
    <\/div>\n
    <\/div>\n<\/div>\n
    \n
    <\/div>\n
    <\/div>\n
    <\/div>\n
    <\/div>\n
    <\/div>\n<\/div>\n

    <\/wiz_tmp_tag><\/p>\n

    \u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1aIPCPU-\u7f51\u7edc\u4e4b\u8def<\/a> » Python\u4e4b\u7cfb\u7edf\u4ea4\u4e92(\u8c03\u7528\u7cfb\u7edf\u547d\u4ee4)subprocess<\/a><\/p>","protected":false},"excerpt":{"rendered":"

    \u5728\u65e9\u671f\u7684Python\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u4e3b\u8981\u662f\u901a\u8fc7os.system()\u3001os.popen().read()\u7b49\u51fd\u6570\u6765\u6267\u884c\u547d\u4ee4\u884c\u6307\u4ee4\u7684\uff0c\u53e6\u5916\u8fd8\u6709\u4e00\u4e2a\u5f88\u5c11\u4f7f\u7528\u7684commands\u6a21\u5757\u3002\u4f46\u662f\u4ecePython 2.4\u5f00\u59cb\u5b98\u65b9\u6587\u6863\u4e2d\u5efa\u8bae\u4f7f\u7528\u7684\u662fsubprocess\u6a21\u5757\u3002\uff08\u672c\u6587\u7684\u4f8b\u5b50\u5168\u90e8\u662f\u4ee5Python3.5\u4e3a\u8fd0\u884c\u73af\u5883\uff09 \u5bf9\u4e8e\u8c03\u7528\u4e00\u4e2a\u7cfb\u7edf\u547d\u4ee4\uff0c\u6211\u4eec\u6700\u5173\u5fc3\u7684\u6709\u5982\u4e0b\u51e0\u70b9\uff1a \u547d\u4ee4\u6267\u884c\u7684\u72b6\u6001\u7801–\u8868\u793a\u547d\u4ee4\u6267\u884c\u662f\u5426\u6210\u529f \u547d\u4ee4\u6267\u884c\u7684\u8f93\u51fa\u7ed3\u679c–\u547d\u4ee4\u6267\u884c\u6210\u529f\u540e\u6216\u8005\u9519\u8bef\u540e\u7684\u8f93\u51fa \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5206\u522b\u770b\u4e0b\u8fd9\u51e0\u79cd\u65b9\u6cd5\u3002 \u4e00\u3001os.system()\u548cos.popen()\u7684\u7528\u6cd5 \u6211\u4eec\u5148\u6765\u770b\u4e0bos.system()\u7684\u7528\u6cd5\uff1a #!\/usr\/bin\/python import os print(‘–os.system-code0–‘) res = os.system(‘ls’) print(type(res)) print(res) print(‘–os.system-codenot0-‘) res = os.system(‘lsa’) print(type(res)) print(res) \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b –os.system-code0– aa.py anaconda-ks.cfg debug.log original-ks.cfg <class ‘int’> 0 –os.system-codenot0- sh: lsa: command not found <class ‘int’> 32512 \u7ed3\u8bba\uff1aos.system(command)\u4f1a\u8fd4\u56de\u547d\u4ee4\u6267\u884c\u7684\u8fd4\u56de\u7801\uff0c\u800c\u5c06\u547d\u4ee4\u6267\u884c\u7ed3\u679c\u8f93\u51fa\u5230\u5c4f\u5e55\u3002 os.popen()\u7684\u4ee3\u7801\u5982\u4e0b print(‘–os.popen–‘) res = os.popen(‘ls’) print(type(res)) print(res.read()) \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b –os.popen– <class ‘os._wrap_close’> aa.py anaconda-ks.cfg […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,13],"tags":[17,59,176,177],"_links":{"self":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1050"}],"collection":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/comments?post=1050"}],"version-history":[{"count":1,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1050\/revisions"}],"predecessor-version":[{"id":1051,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1050\/revisions\/1051"}],"wp:attachment":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/media?parent=1050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/categories?post=1050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/tags?post=1050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}