{"id":1045829,"date":"2024-12-31T13:27:37","date_gmt":"2024-12-31T05:27:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1045829.html"},"modified":"2024-12-31T13:27:43","modified_gmt":"2024-12-31T05:27:43","slug":"python%e5%a6%82%e4%bd%95%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%be%93%e5%87%ba%e5%88%b0%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1045829.html","title":{"rendered":"python\u5982\u4f55\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/00f34322-ea10-42a9-bf6a-d948ed41a43d.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>Python \u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6587\u4ef6\u7684\u4e3b\u8981\u65b9\u6cd5\u6709\uff1aopen()\u51fd\u6570\u3001with\u8bed\u53e5\u3001write()\u65b9\u6cd5\u3002<\/strong> \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\uff0c\u5e76\u786e\u4fdd\u6587\u4ef6\u6b63\u786e\u5173\u95ed\u3002\u63a5\u4e0b\u6765\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5176\u4e2d\u4e00\u4e2a\u5e38\u7528\u65b9\u6cd5\uff0c\u5373\u4f7f\u7528with\u8bed\u53e5\u7ba1\u7406\u6587\u4ef6\u64cd\u4f5c\uff0c\u786e\u4fdd\u5728\u5199\u5165\u5b8c\u6210\u540e\u81ea\u52a8\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u5f53\u6211\u4eec\u9700\u8981\u5c06\u5b57\u7b26\u4e32\u5185\u5bb9\u8f93\u51fa\u5230\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5185\u7f6e\u51fd\u6570\u548c\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528open()\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5bf9\u8c61\uff0c\u7136\u540e\u4f7f\u7528write()\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u3002\u4e3a\u4e86\u786e\u4fdd\u6587\u4ef6\u5728\u64cd\u4f5c\u5b8c\u6210\u540e\u80fd\u591f\u6b63\u786e\u5173\u95ed\uff0c\u63a8\u8350\u4f7f\u7528with\u8bed\u53e5\uff0c\u5b83\u53ef\u4ee5\u81ea\u52a8\u7ba1\u7406\u6587\u4ef6\u7684\u6253\u5f00\u548c\u5173\u95ed\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528open()\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Python\u7684open()\u51fd\u6570\u662f\u7528\u6765\u6253\u5f00\u6587\u4ef6\u7684\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u6587\u4ef6\u5bf9\u8c61\u3002open()\u51fd\u6570\u7684\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_object = open(file_name, mode)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c<code>file_name<\/code>\u662f\u8981\u6253\u5f00\u7684\u6587\u4ef6\u7684\u540d\u79f0\uff08\u5305\u62ec\u8def\u5f84\uff09\uff0c<code>mode<\/code>\u662f\u6587\u4ef6\u6253\u5f00\u6a21\u5f0f\u3002\u5e38\u89c1\u7684\u6a21\u5f0f\u5305\u62ec\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>&#39;r&#39;<\/code>\uff1a\u53ea\u8bfb\u6a21\u5f0f\uff0c\u6587\u4ef6\u5fc5\u987b\u5b58\u5728\u3002<\/li>\n<li><code>&#39;w&#39;<\/code>\uff1a\u5199\u5165\u6a21\u5f0f\uff0c\u6587\u4ef6\u5b58\u5728\u5219\u6e05\u7a7a\u6587\u4ef6\u5185\u5bb9\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\u65b0\u6587\u4ef6\u3002<\/li>\n<li><code>&#39;a&#39;<\/code>\uff1a\u8ffd\u52a0\u6a21\u5f0f\uff0c\u6587\u4ef6\u5b58\u5728\u5219\u5728\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u5185\u5bb9\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\u65b0\u6587\u4ef6\u3002<\/li>\n<li><code>&#39;b&#39;<\/code>\uff1a\u4e8c\u8fdb\u5236\u6a21\u5f0f\uff0c\u5e38\u4e0e\u5176\u4ed6\u6a21\u5f0f\u7ed3\u5408\u4f7f\u7528\uff0c\u5982 <code>&#39;rb&#39;<\/code>\uff08\u4e8c\u8fdb\u5236\u53ea\u8bfb\uff09\u548c <code>&#39;wb&#39;<\/code>\uff08\u4e8c\u8fdb\u5236\u5199\u5165\uff09\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u4f7f\u7528with\u8bed\u53e5<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528with\u8bed\u53e5\u53ef\u4ee5\u81ea\u52a8\u7ba1\u7406\u6587\u4ef6\u7684\u6253\u5f00\u548c\u5173\u95ed\uff0c\u907f\u514d\u5fd8\u8bb0\u5173\u95ed\u6587\u4ef6\u5bfc\u81f4\u8d44\u6e90\u6cc4\u9732\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528with\u8bed\u53e5\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">string_content = &quot;Hello, World!&quot;<\/p>\n<p>file_name = &quot;example.txt&quot;<\/p>\n<p>with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>    file.write(string_content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>with open(file_name, &#39;w&#39;) as file:<\/code> \u8fd9\u884c\u4ee3\u7801\u4f1a\u6253\u5f00\u6587\u4ef6example.txt\uff0c\u5e76\u4ee5\u5199\u5165\u6a21\u5f0f\u6253\u5f00\u3002\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u3002<code>file.write(string_content)<\/code> \u8fd9\u884c\u4ee3\u7801\u5c06\u5b57\u7b26\u4e32\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u3002\u5728with\u8bed\u53e5\u5757\u7ed3\u675f\u65f6\uff0c\u6587\u4ef6\u4f1a\u81ea\u52a8\u5173\u95ed\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5199\u5165\u591a\u884c\u5b57\u7b26\u4e32<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5c06\u591a\u884c\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u884c\u5b57\u7b26\u4e32\uff08triple-quoted string\uff09\u6216\u5c06\u591a\u884c\u5185\u5bb9\u5b58\u50a8\u5728\u5217\u8868\u4e2d\uff0c\u7136\u540e\u9010\u884c\u5199\u5165\u6587\u4ef6\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">multi_line_string = &quot;&quot;&quot;Line 1<\/p>\n<p>Line 2<\/p>\n<p>Line 3&quot;&quot;&quot;<\/p>\n<p>file_name = &quot;multi_line_example.txt&quot;<\/p>\n<p>with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>    file.write(multi_line_string)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\u4f7f\u7528\u5217\u8868\u548c\u5faa\u73af\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">lines = [&quot;Line 1\\n&quot;, &quot;Line 2\\n&quot;, &quot;Line 3\\n&quot;]<\/p>\n<p>file_name = &quot;multi_line_example.txt&quot;<\/p>\n<p>with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>    file.writelines(lines)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u6587\u4ef6\u8def\u5f84<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u6587\u4ef6\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u6216\u76f8\u5bf9\u8def\u5f84\uff0c\u4ee5\u786e\u4fdd\u6587\u4ef6\u80fd\u88ab\u6b63\u786e\u627e\u5230\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/strong><\/h2>\n<p>current_dir = os.getcwd()<\/p>\n<h2><strong>\u62fc\u63a5\u6587\u4ef6\u8def\u5f84<\/strong><\/h2>\n<p>file_name = os.path.join(current_dir, &quot;example.txt&quot;)<\/p>\n<h2><strong>\u6253\u5f00\u6587\u4ef6\u5e76\u5199\u5165\u5185\u5bb9<\/strong><\/h2>\n<p>with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>    file.write(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5f02\u5e38\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u907f\u514d\u6587\u4ef6\u64cd\u4f5c\u4e2d\u7684\u610f\u5916\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528try-except\u8bed\u53e5\u8fdb\u884c\u5f02\u5e38\u5904\u7406\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_name = &quot;example.txt&quot;<\/p>\n<p>try:<\/p>\n<p>    with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>        file.write(&quot;Hello, World!&quot;)<\/p>\n<p>except IOError as e:<\/p>\n<p>    print(f&quot;An error occurred: {e}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u8ffd\u52a0\u6a21\u5f0f\u5199\u5165<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5728\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528\u8ffd\u52a0\u6a21\u5f0f <code>&#39;a&#39;<\/code>\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_name = &quot;example.txt&quot;<\/p>\n<p>with open(file_name, &#39;a&#39;) as file:<\/p>\n<p>    file.write(&quot;\\nAppended content&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u4e8c\u8fdb\u5236\u6a21\u5f0f\u5199\u5165<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u975e\u6587\u672c\u6587\u4ef6\uff08\u5982\u56fe\u7247\u3001\u89c6\u9891\uff09\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e8c\u8fdb\u5236\u6a21\u5f0f <code>&#39;wb&#39;<\/code>\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">binary_content = b&quot;Binary data&quot;<\/p>\n<p>file_name = &quot;binary_example.bin&quot;<\/p>\n<p>with open(file_name, &#39;wb&#39;) as file:<\/p>\n<p>    file.write(binary_content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u6587\u4ef6\u7f16\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5305\u542b\u7279\u6b8a\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u6307\u5b9a\u6587\u4ef6\u7f16\u7801\u3002\u5e38\u89c1\u7684\u7f16\u7801\u5305\u62ec UTF-8 \u548c GBK\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">string_content = &quot;\u4f60\u597d\uff0c\u4e16\u754c\uff01&quot;<\/p>\n<p>file_name = &quot;utf8_example.txt&quot;<\/p>\n<p>with open(file_name, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    file.write(string_content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e5d\u3001\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u9a8c\u8bc1\u5199\u5165\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u6253\u5370\u51fa\u6765\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_name = &quot;example.txt&quot;<\/p>\n<p>with open(file_name, &#39;r&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5341\u3001\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u65b9\u4fbf\u5730\u5c06\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6587\u4ef6\u3002<strong>\u4f7f\u7528open()\u51fd\u6570\u521b\u5efa\u6587\u4ef6\u5bf9\u8c61\u3001with\u8bed\u53e5\u7ba1\u7406\u6587\u4ef6\u64cd\u4f5c\u3001write()\u65b9\u6cd5\u5199\u5165\u5185\u5bb9<\/strong>\uff0c\u662f\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u7684\u5173\u952e\u6b65\u9aa4\u3002\u65e0\u8bba\u662f\u5355\u884c\u5b57\u7b26\u4e32\u3001\u591a\u884c\u5b57\u7b26\u4e32\u3001\u4e8c\u8fdb\u5236\u5185\u5bb9\uff0c\u8fd8\u662f\u5904\u7406\u6587\u4ef6\u8def\u5f84\u548c\u7f16\u7801\uff0c\u4ee5\u4e0a\u65b9\u6cd5\u90fd\u80fd\u6ee1\u8db3\u4e0d\u540c\u9700\u6c42\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u7406\u89e3\u548c\u638c\u63e1Python\u6587\u4ef6\u64cd\u4f5c\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>open()<\/code>\u51fd\u6570\u6765\u6253\u5f00\u6587\u4ef6\uff0c\u5e76\u7ed3\u5408<code>write()<\/code>\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">with open(&#39;output.txt&#39;, &#39;w&#39;) as file:\n    file.write(&#39;\u8fd9\u662f\u8981\u5199\u5165\u6587\u4ef6\u7684\u5b57\u7b26\u4e32\u3002&#39;)\n<\/code><\/pre>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u4f1a\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u540d\u4e3a<code>output.txt<\/code>\u7684\u6587\u4ef6\u4e2d\u3002\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u4f1a\u81ea\u52a8\u521b\u5efa\u8be5\u6587\u4ef6\u3002<\/p>\n<p><strong>\u5728\u5199\u5165\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u786e\u4fdd\u6587\u4ef6\u5185\u5bb9\u4e0d\u88ab\u8986\u76d6\uff1f<\/strong><br \/>\u4e3a\u4e86\u907f\u514d\u8986\u76d6\u5df2\u6709\u6587\u4ef6\u5185\u5bb9\uff0c\u53ef\u4ee5\u5728\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u65f6\uff0c\u5c06\u6a21\u5f0f\u53c2\u6570\u8bbe\u7f6e\u4e3a<code>&#39;a&#39;<\/code>\uff08\u8ffd\u52a0\u6a21\u5f0f\uff09\u3002\u8fd9\u6837\uff0c\u6bcf\u6b21\u5199\u5165\u64cd\u4f5c\u90fd\u4f1a\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u65b0\u5185\u5bb9\uff0c\u800c\u4e0d\u662f\u66ff\u6362\u539f\u6709\u5185\u5bb9\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">with open(&#39;output.txt&#39;, &#39;a&#39;) as file:\n    file.write(&#39;\u8ffd\u52a0\u7684\u5b57\u7b26\u4e32\u3002\\n&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u5728\u73b0\u6709\u5185\u5bb9\u540e\u6dfb\u52a0\u65b0\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u5199\u5165\u6587\u4ef6\u65f6\u53ef\u80fd\u51fa\u73b0\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u5728\u5199\u5165\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6743\u9650\u95ee\u9898\u6216\u6587\u4ef6\u8def\u5f84\u9519\u8bef\u7b49\u95ee\u9898\u3002\u53ef\u4ee5\u4f7f\u7528<code>try...except<\/code>\u8bed\u53e5\u6765\u6355\u83b7\u5f02\u5e38\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">try:\n    with open(&#39;output.txt&#39;, &#39;w&#39;) as file:\n        file.write(&#39;\u5199\u5165\u6587\u4ef6\u7684\u5b57\u7b26\u4e32\u3002&#39;)\nexcept IOError as e:\n    print(f&#39;\u5199\u5165\u6587\u4ef6\u65f6\u53d1\u751f\u9519\u8bef: {e}&#39;)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u6837\u7684\u9519\u8bef\u5904\u7406\uff0c\u53ef\u4ee5\u5728\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u53ca\u65f6\u83b7\u5f97\u53cd\u9988\u5e76\u91c7\u53d6\u9002\u5f53\u7684\u63aa\u65bd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python \u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6587\u4ef6\u7684\u4e3b\u8981\u65b9\u6cd5\u6709\uff1aopen()\u51fd\u6570\u3001with\u8bed\u53e5\u3001write()\u65b9\u6cd5\u3002 \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 [&hellip;]","protected":false},"author":3,"featured_media":1045850,"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\/1045829"}],"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=1045829"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1045829\/revisions"}],"predecessor-version":[{"id":1045852,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1045829\/revisions\/1045852"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1045850"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1045829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1045829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1045829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}