{"id":1117366,"date":"2025-01-08T18:25:21","date_gmt":"2025-01-08T10:25:21","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1117366.html"},"modified":"2025-01-08T18:25:23","modified_gmt":"2025-01-08T10:25:23","slug":"python%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80%e4%b8%80%e4%b8%aatxt%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1117366.html","title":{"rendered":"python\u5982\u4f55\u6253\u5f00\u4e00\u4e2atxt\u6587\u6863"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081316\/abd06c52-8f61-4b98-bee6-483c11b0a716.webp\" alt=\"python\u5982\u4f55\u6253\u5f00\u4e00\u4e2atxt\u6587\u6863\" \/><\/p>\n<p><p> \u4e00\u3001\u76f4\u63a5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>open()<\/code>\u51fd\u6570\u3001\u6307\u5b9a\u6587\u4ef6\u8def\u5f84\u4e0e\u6a21\u5f0f\u3001\u5904\u7406\u6587\u4ef6\u5185\u5bb9<\/p>\n<\/p>\n<p><p>Python\u4e2d\u53ef\u4ee5\u901a\u8fc7\u5185\u7f6e\u7684<code>open()<\/code>\u51fd\u6570\u6765\u6253\u5f00\u4e00\u4e2atxt\u6587\u6863\uff0c\u6307\u5b9a\u6587\u4ef6\u8def\u5f84\u4e0e\u64cd\u4f5c\u6a21\u5f0f\uff0c\u5e76\u5bf9\u6587\u4ef6\u5185\u5bb9\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\u3002<strong>\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bfb\u53d6\u6a21\u5f0f(&#39;r&#39;)\u6765\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5199\u5165\u6a21\u5f0f(&#39;w&#39;)\u6765\u521b\u5efa\u6216\u8986\u76d6\u6587\u4ef6\u5185\u5bb9\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u8ffd\u52a0\u6a21\u5f0f(&#39;a&#39;)\u6765\u5728\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u5185\u5bb9<\/strong>\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u6253\u5f00txt\u6587\u6863\u5e76\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u6253\u5f00\u5e76\u8bfb\u53d6txt\u6587\u6863<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u6253\u5f00\u5e76\u8bfb\u53d6\u4e00\u4e2atxt\u6587\u6863\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 open() \u51fd\u6570\u6253\u5f00\u6587\u4ef6<\/p>\n<p>file = open(&#39;example.txt&#39;, &#39;r&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/strong><\/h2>\n<p>content = file.read()<\/p>\n<h2><strong>\u8f93\u51fa\u8bfb\u53d6\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>print(content)<\/p>\n<h2><strong>\u5173\u95ed\u6587\u4ef6<\/strong><\/h2>\n<p>file.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u4ee5\u8bfb\u53d6\u6a21\u5f0f(&#39;r&#39;)\u6253\u5f00\u4e86\u540d\u4e3a<code>example.txt<\/code>\u7684\u6587\u6863\uff0c\u8bfb\u53d6\u5176\u5185\u5bb9\u540e\uff0c\u5c06\u5185\u5bb9\u6253\u5370\u5230\u63a7\u5236\u53f0\uff0c\u6700\u540e\u8bb0\u5f97\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u7684\u5176\u4ed6\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u9664\u4e86<code>read()<\/code>\u65b9\u6cd5\u5916\uff0cPython\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u51e0\u79cd\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>readline()<\/code>: \u8bfb\u53d6\u6587\u4ef6\u7684\u4e00\u884c\u5185\u5bb9\u3002<\/li>\n<li><code>readlines()<\/code>: \u8bfb\u53d6\u6587\u4ef6\u7684\u6240\u6709\u884c\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6bcf\u884c\u5185\u5bb9\u7684\u5217\u8868\u3002<\/li>\n<\/ul>\n<p><p>\u4e0b\u9762\u662f\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 readline() \u8bfb\u53d6\u6587\u4ef6\u7684\u4e00\u884c\u5185\u5bb9<\/p>\n<p>file = open(&#39;example.txt&#39;, &#39;r&#39;)<\/p>\n<p>line = file.readline()<\/p>\n<p>print(line)<\/p>\n<p>file.close()<\/p>\n<h2><strong>\u4f7f\u7528 readlines() \u8bfb\u53d6\u6587\u4ef6\u7684\u6240\u6709\u884c<\/strong><\/h2>\n<p>file = open(&#39;example.txt&#39;, &#39;r&#39;)<\/p>\n<p>lines = file.readlines()<\/p>\n<p>for line in lines:<\/p>\n<p>    print(line)<\/p>\n<p>file.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u6253\u5f00\u5e76\u5199\u5165txt\u6587\u6863<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u6253\u5f00\u5e76\u5199\u5165\u4e00\u4e2atxt\u6587\u6863\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 open() \u51fd\u6570\u4ee5\u5199\u5165\u6a21\u5f0f(&#39;w&#39;)\u6253\u5f00\u6587\u4ef6<\/p>\n<p>file = open(&#39;example.txt&#39;, &#39;w&#39;)<\/p>\n<h2><strong>\u5199\u5165\u5185\u5bb9\u5230\u6587\u4ef6<\/strong><\/h2>\n<p>file.write(&#39;Hello, world!&#39;)<\/p>\n<h2><strong>\u5173\u95ed\u6587\u4ef6<\/strong><\/h2>\n<p>file.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u4ee5\u5199\u5165\u6a21\u5f0f(&#39;w&#39;)\u6253\u5f00\u4e86\u540d\u4e3a<code>example.txt<\/code>\u7684\u6587\u6863\uff0c\u5e76\u5411\u5176\u4e2d\u5199\u5165\u4e86\u5b57\u7b26\u4e32<code>&#39;Hello, world!&#39;<\/code>\uff0c\u6700\u540e\u5173\u95ed\u6587\u4ef6\u3002\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c06\u4f1a\u81ea\u52a8\u521b\u5efa\u8be5\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>\u8ffd\u52a0\u5185\u5bb9\u5230\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5e0c\u671b\u5728\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u5185\u5bb9\uff0c\u800c\u4e0d\u662f\u8986\u76d6\u6587\u4ef6\u539f\u6709\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528\u8ffd\u52a0\u6a21\u5f0f(&#39;a&#39;)\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 open() \u51fd\u6570\u4ee5\u8ffd\u52a0\u6a21\u5f0f(&#39;a&#39;)\u6253\u5f00\u6587\u4ef6<\/p>\n<p>file = open(&#39;example.txt&#39;, &#39;a&#39;)<\/p>\n<h2><strong>\u8ffd\u52a0\u5185\u5bb9\u5230\u6587\u4ef6<\/strong><\/h2>\n<p>file.write(&#39;\\nAppend this line.&#39;)<\/p>\n<h2><strong>\u5173\u95ed\u6587\u4ef6<\/strong><\/h2>\n<p>file.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>with<\/code>\u8bed\u53e5\u7ba1\u7406\u6587\u4ef6\u4e0a\u4e0b\u6587<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u7f16\u7a0b\u4e2d\uff0c\u63a8\u8350\u4f7f\u7528<code>with<\/code>\u8bed\u53e5\u6765\u7ba1\u7406\u6587\u4ef6\u4e0a\u4e0b\u6587\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6587\u4ef6\u5728\u4f7f\u7528\u5b8c\u6bd5\u540e\u81ea\u52a8\u5173\u95ed\uff0c\u907f\u514d\u6587\u4ef6\u672a\u5173\u95ed\u5bfc\u81f4\u7684\u8d44\u6e90\u6cc4\u9732\u95ee\u9898\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 with \u8bed\u53e5\u6253\u5f00\u5e76\u8bfb\u53d6\u6587\u4ef6<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;r&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<h2><strong>\u4f7f\u7528 with \u8bed\u53e5\u6253\u5f00\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;example.txt&#39;, &#39;w&#39;) as file:<\/p>\n<p>    file.write(&#39;Hello, world!&#39;)<\/p>\n<h2><strong>\u4f7f\u7528 with \u8bed\u53e5\u4ee5\u8ffd\u52a0\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;example.txt&#39;, &#39;a&#39;) as file:<\/p>\n<p>    file.write(&#39;\\nAppend this line.&#39;)<\/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\u8def\u5f84\u65f6\uff0c\u63a8\u8350\u4f7f\u7528<code>os<\/code>\u6a21\u5757\u4e2d\u7684<code>path<\/code>\u5b50\u6a21\u5757\u6765\u6784\u5efa\u8def\u5f84\uff0c\u4ee5\u4fdd\u8bc1\u4ee3\u7801\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u517c\u5bb9\u6027\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u6784\u5efa\u6587\u4ef6\u8def\u5f84<\/strong><\/h2>\n<p>file_path = os.path.join(&#39;directory&#39;, &#39;example.txt&#39;)<\/p>\n<h2><strong>\u4f7f\u7528 with \u8bed\u53e5\u6253\u5f00\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_path, &#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>\u4e94\u3001\u5904\u7406\u6587\u4ef6\u7f16\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5305\u542b\u975eASCII\u5b57\u7b26\u7684\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u6307\u5b9a\u6587\u4ef6\u7f16\u7801\uff0c\u5982UTF-8\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 open() \u51fd\u6570\u5e76\u6307\u5b9a\u7f16\u7801<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u793a\u4f8b\u4ee3\u7801\u6c47\u603b<\/h3>\n<\/p>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u5305\u542b\u8bfb\u53d6\u3001\u5199\u5165\u3001\u8ffd\u52a0\u6587\u4ef6\u5185\u5bb9\u7684\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u6784\u5efa\u6587\u4ef6\u8def\u5f84<\/strong><\/h2>\n<p>file_path = os.path.join(&#39;directory&#39;, &#39;example.txt&#39;)<\/p>\n<h2><strong>\u5199\u5165\u5185\u5bb9\u5230\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    file.write(&#39;Hello, world!\\n&#39;)<\/p>\n<h2><strong>\u8ffd\u52a0\u5185\u5bb9\u5230\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_path, &#39;a&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    file.write(&#39;Append this line.\\n&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/strong><\/h2>\n<p>with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u4f7f\u7528Python\u6253\u5f00\u5e76\u5904\u7406txt\u6587\u6863\u3002\u65e0\u8bba\u662f\u8bfb\u53d6\u3001\u5199\u5165\u8fd8\u662f\u8ffd\u52a0\u5185\u5bb9\uff0cPython\u90fd\u63d0\u4f9b\u4e86\u7b80\u6d01\u4e14\u5f3a\u5927\u7684\u65b9\u6cd5\u6765\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bfb\u53d6txt\u6587\u4ef6\u7684\u5185\u5bb9\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>open()<\/code>\u51fd\u6570\u6765\u6253\u5f00txt\u6587\u4ef6\uff0c\u5e76\u7ed3\u5408<code>read()<\/code>\u3001<code>readline()<\/code>\u6216<code>readlines()<\/code>\u65b9\u6cd5\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u3002\u4f7f\u7528<code>with<\/code>\u8bed\u53e5\u53ef\u4ee5\u786e\u4fdd\u6587\u4ef6\u5728\u8bfb\u53d6\u540e\u81ea\u52a8\u5173\u95ed\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;r&#39;) as file:\n    content = file.read()\n    print(content)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u7b80\u5316\u4e86\u4ee3\u7801\uff0c\u8fd8\u907f\u514d\u4e86\u6587\u4ef6\u672a\u5173\u95ed\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898\u3002<\/p>\n<p><strong>\u5728\u6253\u5f00txt\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u5904\u7406\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u60c5\u51b5\uff1f<\/strong><br \/>\u5f53\u5c1d\u8bd5\u6253\u5f00\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684txt\u6587\u4ef6\u65f6\uff0cPython\u4f1a\u5f15\u53d1<code>FileNotFoundError<\/code>\u5f02\u5e38\u3002\u4e3a\u4e86\u5b89\u5168\u5904\u7406\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try-except<\/code>\u8bed\u53e5\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">try:\n    with open(&#39;nonexistent.txt&#39;, &#39;r&#39;) as file:\n        content = file.read()\nexcept FileNotFoundError:\n    print(&quot;\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u8bf7\u68c0\u67e5\u6587\u4ef6\u8def\u5f84\u3002&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u7684\u5904\u7406\u65b9\u5f0f\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\uff0c\u786e\u4fdd\u7528\u6237\u80fd\u591f\u83b7\u5f97\u660e\u786e\u7684\u53cd\u9988\u3002<\/p>\n<p><strong>\u5728\u6253\u5f00txt\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u4ee5\u8ffd\u52a0\u6a21\u5f0f\u5199\u5165\u5185\u5bb9\uff1f<\/strong><br \/>\u5982\u679c\u9700\u8981\u5728txt\u6587\u4ef6\u4e2d\u6dfb\u52a0\u65b0\u5185\u5bb9\u800c\u4e0d\u662f\u8986\u76d6\u73b0\u6709\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528<code>&#39;a&#39;<\/code>\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\u3002\u8fd9\u6837\u53ef\u4ee5\u5c06\u6570\u636e\u8ffd\u52a0\u5230\u6587\u4ef6\u672b\u5c3e\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;a&#39;) as file:\n    file.write(&#39;\\n\u8fd9\u662f\u8ffd\u52a0\u7684\u65b0\u5185\u5bb9\u3002&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u975e\u5e38\u9002\u5408\u65e5\u5fd7\u8bb0\u5f55\u6216\u4e0d\u65ad\u66f4\u65b0\u7684\u6587\u672c\u6587\u4ef6\uff0c\u786e\u4fdd\u4e4b\u524d\u7684\u6570\u636e\u4e0d\u4f1a\u4e22\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u76f4\u63a5\u4f7f\u7528Python\u5185\u7f6e\u7684open()\u51fd\u6570\u3001\u6307\u5b9a\u6587\u4ef6\u8def\u5f84\u4e0e\u6a21\u5f0f\u3001\u5904\u7406\u6587\u4ef6\u5185\u5bb9 Python\u4e2d\u53ef\u4ee5\u901a\u8fc7\u5185\u7f6e\u7684 [&hellip;]","protected":false},"author":3,"featured_media":1117372,"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\/1117366"}],"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=1117366"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1117366\/revisions"}],"predecessor-version":[{"id":1117373,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1117366\/revisions\/1117373"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1117372"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1117366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1117366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1117366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}