{"id":962788,"date":"2024-12-27T04:11:35","date_gmt":"2024-12-26T20:11:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/962788.html"},"modified":"2024-12-27T04:11:38","modified_gmt":"2024-12-26T20:11:38","slug":"%e5%a6%82%e4%bd%95python2%e5%85%bc%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/962788.html","title":{"rendered":"\u5982\u4f55python2\u517c\u5bb9"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25104640\/ca0a0cdc-b8ee-47c0-84a9-4576461475f9.webp\" alt=\"\u5982\u4f55python2\u517c\u5bb9\" \/><\/p>\n<p><p> <strong>\u4e3a\u4e86\u4f7fPython 2\u4ee3\u7801\u517c\u5bb9Python 3\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528__future__\u6a21\u5757\u3001\u4f7f\u7528six\u5e93\u3001\u907f\u514d\u4f7f\u7528Python 2\u4e2d\u7279\u6709\u7684\u8bed\u6cd5\u548c\u6a21\u5757\u3001\u9010\u6b65\u8fc7\u6e21\u548c\u6d4b\u8bd5\u3002<\/strong>\u5176\u4e2d\uff0c__future__\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728Python 2\u4e2d\u4f7f\u7528Python 3\u7279\u6027\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u800c\u4e0d\u662f<code>print<\/code>\u8bed\u53e5\u3002\u8fd9\u4e3a\u4ee3\u7801\u5728Python 2\u548cPython 3\u4e4b\u95f4\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u517c\u5bb9\u6027\u3002\u901a\u8fc7\u5bfc\u5165<code>from __future__ import print_function<\/code>\uff0c\u53ef\u4ee5\u5728Python 2\u4e2d\u4f7f\u7528Python 3\u7684<code>print()<\/code>\u51fd\u6570\uff0c\u4ece\u800c\u51cf\u5c11\u672a\u6765\u7684\u8fc1\u79fb\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u4f7f\u7528 <strong>future<\/strong> \u6a21\u5757<\/h3>\n<\/p>\n<p><p>Python 2\u63d0\u4f9b\u4e86__future__\u6a21\u5757\uff0c\u5141\u8bb8\u5728Python 2\u4e2d\u5f15\u5165\u90e8\u5206Python 3\u7684\u7279\u6027\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba9\u4ee3\u7801\u5728\u4e24\u79cd\u7248\u672c\u4e4b\u95f4\u66f4\u5177\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5f15\u5165Python 3\u7684print\u51fd\u6570<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 2\u4e2d\uff0c<code>print<\/code>\u662f\u4e00\u4e2a\u8bed\u53e5\uff0c\u800c\u5728Python 3\u4e2d\uff0c<code>print()<\/code>\u662f\u4e00\u4e2a\u51fd\u6570\u3002\u4e3a\u4e86\u5728Python 2\u4e2d\u4f7f\u7528Python 3\u7684<code>print()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from __future__ import print_function<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\u505a\u53ef\u4ee5\u786e\u4fdd\u4ee3\u7801\u5728Python 3\u4e2d\u8fd0\u884c\u65f6\u4e0d\u9700\u8981\u4fee\u6539\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5176\u4ed6__future__\u7279\u6027<\/strong><\/p>\n<\/p>\n<p><p>\u9664\u4e86<code>print_function<\/code>\u4e4b\u5916\uff0c__future__\u6a21\u5757\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u7279\u6027\uff0c\u6bd4\u5982<code>division<\/code>\uff08\u4f7f\u9664\u6cd5\u8fd0\u7b97\u8fd4\u56de\u6d6e\u70b9\u6570\u800c\u975e\u6574\u6570\uff09\u3001<code>unicode_literals<\/code>\uff08\u9ed8\u8ba4\u5c06\u5b57\u7b26\u4e32\u8bc6\u522b\u4e3aUnicode\uff09\u7b49\u3002\u6839\u636e\u9700\u8981\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u5f15\u5165\u8fd9\u4e9b\u7279\u6027\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from __future__ import division, unicode_literals<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u4f7f\u7528six\u5e93<\/h3>\n<\/p>\n<p><p>Six\u662f\u4e00\u4e2aPython\u5e93\uff0c\u4e13\u95e8\u8bbe\u8ba1\u7528\u4e8e\u5728Python 2\u548c3\u4e4b\u95f4\u7f16\u5199\u517c\u5bb9\u4ee3\u7801\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u62bd\u8c61\u5c42\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u8f7b\u677e\u5730\u5904\u7406\u7248\u672c\u5dee\u5f02\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5six\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5six\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528pip\u6765\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install six<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528six\u5904\u7406\u5b57\u7b26\u4e32\u548c\u5b57\u8282<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 2\u548c3\u4e2d\uff0c\u5b57\u7b26\u4e32\u548c\u5b57\u8282\u5904\u7406\u5b58\u5728\u5dee\u5f02\u3002Six\u5e93\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u5de5\u5177\u6765\u5904\u7406\u8fd9\u4e9b\u5dee\u5f02\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import six<\/p>\n<p>if six.PY2:<\/p>\n<p>    text_type = unicode<\/p>\n<p>    binary_type = str<\/p>\n<p>else:<\/p>\n<p>    text_type = str<\/p>\n<p>    binary_type = bytes<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528six\u5904\u7406\u6a21\u5757\u5dee\u5f02<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u4e9bPython\u6807\u51c6\u5e93\u5728Python 2\u548c3\u4e2d\u6709\u6240\u4e0d\u540c\uff0csix\u5e93\u63d0\u4f9b\u4e86\u7edf\u4e00\u7684\u63a5\u53e3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from six.moves import range<\/p>\n<p>from six.moves import input<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7six.moves\u6a21\u5757\uff0c\u53ef\u4ee5\u5728Python 2\u548c3\u4e2d\u4f7f\u7528\u76f8\u540c\u7684\u4ee3\u7801\u6765\u8c03\u7528\u8fd9\u4e9b\u51fd\u6570\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u907f\u514d\u4f7f\u7528Python 2\u4e2d\u7279\u6709\u7684\u8bed\u6cd5\u548c\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u4ee3\u7801\u7684\u517c\u5bb9\u6027\uff0c\u5c3d\u91cf\u907f\u514d\u4f7f\u7528Python 2\u4e2d\u7279\u6709\u7684\u8bed\u6cd5\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u65b0\u5f0f\u7c7b<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 2\u4e2d\uff0c\u4f7f\u7528\u65b0\u5f0f\u7c7b\uff08\u7ee7\u627f\u81ea<code>object<\/code>\uff09\u53ef\u4ee5\u63d0\u9ad8\u517c\u5bb9\u6027\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass(object):<\/p>\n<p>    pass<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6ce8\u610f\u5f02\u5e38\u5904\u7406\u8bed\u6cd5<\/strong><\/p>\n<\/p>\n<p><p>Python 2\u548c3\u7684\u5f02\u5e38\u5904\u7406\u8bed\u6cd5\u7565\u6709\u4e0d\u540c\u3002\u5728Python 2\u4e2d\uff0c\u4f7f\u7528<code>as<\/code>\u5173\u952e\u5b57\u6765\u6355\u83b7\u5f02\u5e38\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    # \u53ef\u80fd\u629b\u51fa\u5f02\u5e38\u7684\u4ee3\u7801<\/p>\n<p>    pass<\/p>\n<p>except Exception as e:<\/p>\n<p>    print(e)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 2\u548c3\u4e2d\uff0c\u5217\u8868\u63a8\u5bfc\u5f0f\u7684\u8bed\u6cd5\u662f\u76f8\u540c\u7684\uff0c\u5c3d\u91cf\u4f7f\u7528\u8fd9\u79cd\u8bed\u6cd5\u6765\u7b80\u5316\u4ee3\u7801\u5e76\u63d0\u9ad8\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u9010\u6b65\u8fc7\u6e21\u548c\u6d4b\u8bd5<\/h3>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u4ee3\u7801\u517c\u5bb9\u6027\u8c03\u6574\u65f6\uff0c\u5efa\u8bae\u91c7\u7528\u9010\u6b65\u8fc7\u6e21\u548c\u6d4b\u8bd5\u7684\u65b9\u6cd5\uff0c\u4ee5\u786e\u4fdd\u4ee3\u7801\u5728\u4e24\u4e2a\u7248\u672c\u4e2d\u90fd\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4ee3\u7801\u7f16\u5199\u5168\u9762\u7684\u6d4b\u8bd5\u7528\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528unittest\u6216pytest\u7b49\u6d4b\u8bd5\u6846\u67b6\u3002\u901a\u8fc7\u6d4b\u8bd5\u7528\u4f8b\uff0c\u53ef\u4ee5\u9a8c\u8bc1\u4ee3\u7801\u5728Python 2\u548c3\u4e2d\u7684\u6b63\u786e\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u75282to3\u5de5\u5177<\/strong><\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e862to3\u5de5\u5177\uff0c\u53ef\u4ee5\u81ea\u52a8\u5c06Python 2\u4ee3\u7801\u8f6c\u6362\u4e3aPython 3\u4ee3\u7801\u3002\u867d\u7136\u4e0d\u80fd\u4fdd\u8bc1100%\u7684\u8f6c\u6362\u6210\u529f\uff0c\u4f46\u53ef\u4ee5\u4f5c\u4e3a\u8fc1\u79fb\u7684\u8f85\u52a9\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">2to3 -w myscript.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9010\u6b65\u8fc1\u79fb<\/strong><\/p>\n<\/p>\n<p><p>\u4e0d\u8981\u8bd5\u56fe\u4e00\u6b21\u6027\u5b8c\u6210\u6240\u6709\u4ee3\u7801\u7684\u8fc1\u79fb\u3002\u53ef\u4ee5\u5148\u9009\u53d6\u4e00\u90e8\u5206\u4ee3\u7801\u8fdb\u884c\u4fee\u6539\u548c\u6d4b\u8bd5\uff0c\u7136\u540e\u9010\u6b65\u6269\u5c55\u5230\u6574\u4e2a\u9879\u76ee\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u4f7f\u7528\u73b0\u4ee3\u5316\u5de5\u5177\u548c\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u652f\u6301Python 2\u548c3\u7684\u517c\u5bb9\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u73b0\u4ee3\u5316\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4f7f\u7528virtualenv\u6216venv\u521b\u5efa\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u5728Python 2\u548c3\u4e4b\u95f4\u5207\u6362\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">virtualenv -p python2 venv2<\/p>\n<p>virtualenv -p python3 venv3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u81ea\u52a8\u5316\u6784\u5efa\u548c\u6d4b\u8bd5<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<a href=\"https:\/\/docs.pingcode.com\/blog\/devops\/52691.html\" target=\"_blank\">CI\/CD<\/a>\u5de5\u5177\uff08\u5982Travis CI\u3001Jenkins\u7b49\uff09\u8fdb\u884c\u81ea\u52a8\u5316\u6784\u5efa\u548c\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4ee3\u7801\u5728\u6bcf\u6b21\u63d0\u4ea4\u65f6\u90fd\u80fd\u5728Python 2\u548c3\u4e0b\u901a\u8fc7\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6587\u6863\u548c\u6ce8\u91ca<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u8be6\u7ec6\u7684\u6587\u6863\u548c\u6ce8\u91ca\uff0c\u8bf4\u660e\u54ea\u4e9b\u90e8\u5206\u662f\u4e3a\u517c\u5bb9\u6027\u800c\u7279\u522b\u8bbe\u8ba1\u7684\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u672a\u6765\u8fdb\u884c\u8fc1\u79fb\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5728Python 2\u548c3\u4e4b\u95f4\u5b9e\u73b0\u4ee3\u7801\u7684\u517c\u5bb9\u6027\u3002\u867d\u7136Python 2\u5df2\u4e8e2020\u5e74\u505c\u6b62\u5b98\u65b9\u652f\u6301\uff0c\u4f46\u5728\u73b0\u5b9e\u4e2d\u4ecd\u6709\u5927\u91cf\u7684Python 2\u4ee3\u7801\u9700\u8981\u7ef4\u62a4\u548c\u8fc1\u79fb\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u5f00\u53d1\u8005\u5728\u8fd9\u65b9\u9762\u66f4\u597d\u5730\u5b9e\u73b0\u8fc7\u6e21\u548c\u517c\u5bb9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python 2\u548cPython 3\u4e4b\u95f4\u8fdb\u884c\u4ee3\u7801\u517c\u5bb9\uff1f<\/strong><br \/>\u4e3a\u4e86\u786e\u4fdd\u60a8\u7684\u4ee3\u7801\u5728Python 2\u548cPython 3\u4e2d\u90fd\u80fd\u6b63\u5e38\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528<code>__future__<\/code>\u6a21\u5757\u6765\u5bfc\u5165\u4e00\u4e9bPython 3\u7684\u7279\u6027\uff0c\u4f8b\u5982<code>print_function<\/code>\u548c<code>unicode_literals<\/code>\u3002\u6b64\u5916\uff0c\u4f7f\u7528<code>six<\/code>\u6216<code>future<\/code>\u5e93\u53ef\u4ee5\u5e2e\u52a9\u7b80\u5316\u5904\u7406\u8de8\u7248\u672c\u7684\u5dee\u5f02\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u8bed\u6cd5\u5dee\u5f02\u9700\u8981\u6ce8\u610f\uff1f<\/strong><br \/>\u5728Python 2\u548cPython 3\u4e4b\u95f4\uff0c\u6709\u4e00\u4e9b\u663e\u8457\u7684\u8bed\u6cd5\u5dee\u5f02\uff0c\u4f8b\u5982\uff1a  <\/p>\n<ul>\n<li><code>print<\/code>\u5728Python 2\u4e2d\u662f\u4e00\u4e2a\u8bed\u53e5\uff0c\u800c\u5728Python 3\u4e2d\u662f\u4e00\u4e2a\u51fd\u6570\u3002  <\/li>\n<li>\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u5904\u7406\u6709\u6240\u4e0d\u540c\uff0cPython 2\u9ed8\u8ba4\u4f7f\u7528<code>ASCII<\/code>\u7f16\u7801\uff0c\u800cPython 3\u4f7f\u7528<code>UTF-8<\/code>\u3002\u786e\u4fdd\u5728\u5904\u7406\u5b57\u7b26\u4e32\u65f6\u8fdb\u884c\u9002\u5f53\u7684\u7f16\u7801\u548c\u89e3\u7801\u64cd\u4f5c\u3002  <\/li>\n<li><code>input()<\/code>\u51fd\u6570\u5728Python 2\u4e2d\u4f1a\u8bc4\u4f30\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u800c\u5728Python 3\u4e2d\u5219\u8fd4\u56de\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<p><strong>\u5982\u4f55\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684Python\uff1f<\/strong><br \/>\u865a\u62df\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7ba1\u7406\u4e0d\u540c\u9879\u76ee\u6240\u9700\u7684Python\u7248\u672c\u548c\u5e93\u3002\u4f7f\u7528<code>virtualenv<\/code>\u5de5\u5177\u521b\u5efa\u4e00\u4e2a\u4e13\u95e8\u4e3aPython 2\u6216Python 3\u914d\u7f6e\u7684\u73af\u5883\u3002\u8fd9\u6837\uff0c\u60a8\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\uff0c\u800c\u4e0d\u4f1a\u76f8\u4e92\u5e72\u6270\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u786e\u4fdd\u5728\u9700\u8981\u65f6\u8f7b\u677e\u5207\u6362\u548c\u6d4b\u8bd5\u4ee3\u7801\u7684\u517c\u5bb9\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e3a\u4e86\u4f7fPython 2\u4ee3\u7801\u517c\u5bb9Python 3\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528__future__\u6a21\u5757\u3001\u4f7f\u7528six\u5e93\u3001 [&hellip;]","protected":false},"author":3,"featured_media":962800,"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\/962788"}],"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=962788"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962788\/revisions"}],"predecessor-version":[{"id":962804,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962788\/revisions\/962804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/962800"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=962788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=962788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=962788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}