{"id":1048157,"date":"2024-12-31T13:48:38","date_gmt":"2024-12-31T05:48:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1048157.html"},"modified":"2024-12-31T13:48:40","modified_gmt":"2024-12-31T05:48:40","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e5%86%99%e4%b8%80%e8%a1%8c%e5%ad%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1048157.html","title":{"rendered":"\u5982\u4f55\u7528Python\u5199\u4e00\u884c\u5b57"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/ff80f000-8829-42f2-a7ff-6d2a66831c5c.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u7528Python\u5199\u4e00\u884c\u5b57\" \/><\/p>\n<p><p> <strong>\u7528Python\u5199\u4e00\u884c\u5b57\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528print()\u51fd\u6570\u3001\u4f7f\u7528logging\u6a21\u5757\u3001\u5728\u6587\u4ef6\u4e2d\u5199\u5165\u6587\u672c\u7b49\u3002<\/strong>\u5176\u4e2d\u6700\u7b80\u5355\u3001\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528print()\u51fd\u6570\u3002print()\u51fd\u6570\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u51e0\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528print()\u51fd\u6570<\/p>\n<\/p>\n<p><p>\u4f7f\u7528print()\u51fd\u6570\u662fPython\u4e2d\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u65b9\u5f0f\u3002print()\u51fd\u6570\u53ef\u4ee5\u5c06\u4e00\u884c\u6587\u672c\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5b57\u7b26\u4e32&quot;Hello, World!&quot;\u4f1a\u88ab\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u8fd9\u662fPython\u4e2d\u6700\u7b80\u5355\u7684\u8f93\u51fa\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528logging\u6a21\u5757<\/p>\n<\/p>\n<p><p>logging\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u4e3b\u8981\u7528\u4e8e\u8bb0\u5f55\u65e5\u5fd7\u4fe1\u606f\u3002\u4f7f\u7528logging\u6a21\u5757\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4e2d\u8bb0\u5f55\u8c03\u8bd5\u4fe1\u606f\u3001\u9519\u8bef\u4fe1\u606f\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import logging<\/p>\n<p>logging.basicConfig(level=logging.INFO)<\/p>\n<p>logging.info(&quot;This is an info message&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5148\u5bfc\u5165\u4e86logging\u6a21\u5757\uff0c\u7136\u540e\u4f7f\u7528basicConfig()\u51fd\u6570\u8bbe\u7f6e\u65e5\u5fd7\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u8bbe\u7f6e\u65e5\u5fd7\u7ea7\u522b\u4e3aINFO\u3002\u6700\u540e\uff0c\u4f7f\u7528info()\u51fd\u6570\u8bb0\u5f55\u4e00\u6761\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u5199\u5165\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u6587\u672c\u5199\u5165\u6587\u4ef6\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u6765\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd\uff0c\u6700\u5e38\u7528\u7684\u65b9\u5f0f\u662f\u4f7f\u7528open()\u51fd\u6570\u548cwrite()\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&quot;output.txt&quot;, &quot;w&quot;) as file:<\/p>\n<p>    file.write(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528open()\u51fd\u6570\u6253\u5f00\u4e00\u4e2a\u540d\u4e3aoutput.txt\u7684\u6587\u4ef6\uff0c\u6a21\u5f0f\u4e3a\u201cw\u201d\uff08\u5199\u5165\u6a21\u5f0f\uff09\u3002\u7136\u540e\u4f7f\u7528write()\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\u3002\u4f7f\u7528with\u8bed\u53e5\u53ef\u4ee5\u786e\u4fdd\u6587\u4ef6\u5728\u4f7f\u7528\u5b8c\u6bd5\u540e\u81ea\u52a8\u5173\u95ed\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528sys\u6a21\u5757<\/p>\n<\/p>\n<p><p>\u6709\u65f6\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u6587\u672c\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\uff08stdout\uff09\u6216\u6807\u51c6\u9519\u8bef\uff08stderr\uff09\u3002sys\u6a21\u5757\u63d0\u4f9b\u4e86\u5bf9\u8fd9\u4e9b\u6807\u51c6\u6d41\u7684\u8bbf\u95ee\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>sys.stdout.write(&quot;Hello, World!\\n&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528sys.stdout.write()\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u3002\u6ce8\u610f\uff0cwrite()\u65b9\u6cd5\u4e0d\u4f1a\u81ea\u52a8\u6dfb\u52a0\u6362\u884c\u7b26\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u201c\\n\u201d\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316<\/p>\n<\/p>\n<p><p>\u5728\u8f93\u51fa\u6587\u672c\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u5c06\u53d8\u91cf\u7684\u503c\u63d2\u5165\u5230\u5b57\u7b26\u4e32\u4e2d\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u5982f\u5b57\u7b26\u4e32\u3001format()\u65b9\u6cd5\u548c\u767e\u5206\u53f7\u683c\u5f0f\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Alice&quot;<\/p>\n<p>print(f&quot;Hello, {name}!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528f\u5b57\u7b26\u4e32\u5c06\u53d8\u91cfname\u7684\u503c\u63d2\u5165\u5230\u5b57\u7b26\u4e32\u4e2d\u3002f\u5b57\u7b26\u4e32\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u7684\u65b9\u5f0f\uff0c\u4f7f\u7528\u8d77\u6765\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u4f7f\u7528\u591a\u884c\u5b57\u7b26\u4e32<\/p>\n<\/p>\n<p><p>\u6709\u65f6\u6211\u4eec\u9700\u8981\u8f93\u51fa\u591a\u884c\u6587\u672c\uff0cPython\u63d0\u4f9b\u4e86\u591a\u884c\u5b57\u7b26\u4e32\u7684\u652f\u6301\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e09\u5f15\u53f7\uff08&#39;&#39;&#39;\u6216&quot;&quot;&quot;\uff09\u6765\u5b9a\u4e49\u591a\u884c\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">multi_line_string = &quot;&quot;&quot;This is a<\/p>\n<p>multi-line<\/p>\n<p>string.&quot;&quot;&quot;<\/p>\n<p>print(multi_line_string)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e09\u5f15\u53f7\u5b9a\u4e49\u4e86\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\uff0c\u5e76\u5c06\u5176\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u5904\u7406\u7f16\u7801\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u6587\u672c\u65f6\uff0c\u6709\u65f6\u6211\u4eec\u9700\u8981\u5904\u7406\u4e0d\u540c\u7684\u5b57\u7b26\u7f16\u7801\u3002Python\u9ed8\u8ba4\u4f7f\u7528UTF-8\u7f16\u7801\uff0c\u4f46\u6211\u4eec\u4e5f\u53ef\u4ee5\u6307\u5b9a\u5176\u4ed6\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&quot;output.txt&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;) as file:<\/p>\n<p>    file.write(&quot;\u4f60\u597d\uff0c\u4e16\u754c\uff01&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u6307\u5b9a\u4e86\u6587\u4ef6\u7684\u7f16\u7801\u4e3aUTF-8\uff0c\u8fd9\u6837\u53ef\u4ee5\u6b63\u786e\u5904\u7406\u5305\u542b\u4e2d\u6587\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><p>\u516b\u3001\u4f7f\u7528StringIO\u6a21\u5757<\/p>\n<\/p>\n<p><p>StringIO\u6a21\u5757\u63d0\u4f9b\u4e86\u5728\u5185\u5b58\u4e2d\u8bfb\u5199\u5b57\u7b26\u4e32\u7684\u529f\u80fd\uff0c\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u64cd\u4f5c\u3002\u4f7f\u7528StringIO\u6a21\u5757\u53ef\u4ee5\u65b9\u4fbf\u5730\u5904\u7406\u5b57\u7b26\u4e32\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from io import StringIO<\/p>\n<p>output = StringIO()<\/p>\n<p>output.write(&quot;Hello, World!&quot;)<\/p>\n<p>print(output.getvalue())<\/p>\n<p>output.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528StringIO\u6a21\u5757\u521b\u5efa\u4e86\u4e00\u4e2a\u5185\u5b58\u4e2d\u7684\u6587\u4ef6\u5bf9\u8c61\uff0c\u5199\u5165\u5b57\u7b26\u4e32\u540e\u4f7f\u7528getvalue()\u65b9\u6cd5\u83b7\u53d6\u5b57\u7b26\u4e32\u7684\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><p>\u4e5d\u3001\u4f7f\u7528subprocess\u6a21\u5757<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u4ecePython\u811a\u672c\u4e2d\u8c03\u7528\u5916\u90e8\u547d\u4ee4\uff0c\u5e76\u5c06\u8f93\u51fa\u4f5c\u4e3a\u5b57\u7b26\u4e32\u5904\u7406\u3002subprocess\u6a21\u5757\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u5b9e\u73b0\u8fd9\u4e00\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>result = subprocess.run([&quot;echo&quot;, &quot;Hello, World!&quot;], capture_output=True, text=True)<\/p>\n<p>print(result.stdout)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528subprocess.run()\u51fd\u6570\u8c03\u7528\u4e86echo\u547d\u4ee4\uff0c\u5e76\u5c06\u5176\u8f93\u51fa\u6355\u83b7\u4e3a\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><p>\u5341\u3001\u4f7f\u7528\u6a21\u677f\u5b57\u7b26\u4e32<\/p>\n<\/p>\n<p><p>\u6a21\u677f\u5b57\u7b26\u4e32\uff08Template strings\uff09\u662fPython\u6807\u51c6\u5e93\u4e2d\u7684\u4e00\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u5f0f\uff0c\u9002\u7528\u4e8e\u9700\u8981\u53cd\u590d\u63d2\u5165\u76f8\u540c\u53d8\u91cf\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from string import Template<\/p>\n<p>template = Template(&quot;Hello, $name!&quot;)<\/p>\n<p>print(template.substitute(name=&quot;Alice&quot;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Template\u7c7b\u521b\u5efa\u4e86\u4e00\u4e2a\u6a21\u677f\u5b57\u7b26\u4e32\uff0c\u5e76\u4f7f\u7528substitute()\u65b9\u6cd5\u66ff\u6362\u6a21\u677f\u4e2d\u7684\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u8be6\u7ec6\u4e86\u89e3\u4e86\u5728Python\u4e2d\u5199\u4e00\u884c\u5b57\u7684\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528print()\u51fd\u6570\u3001logging\u6a21\u5757\u3001\u5199\u5165\u6587\u4ef6\u3001sys\u6a21\u5757\u3001\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001\u591a\u884c\u5b57\u7b26\u4e32\u3001\u5904\u7406\u7f16\u7801\u95ee\u9898\u3001StringIO\u6a21\u5757\u3001subprocess\u6a21\u5757\u548c\u6a21\u677f\u5b57\u7b26\u4e32\u7b49\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u52a3\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u573a\u666f\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u6587\u672c\u8f93\u51fa\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8f93\u51fa\u6587\u672c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u53ef\u4ee5\u8f7b\u677e\u8f93\u51fa\u6587\u672c\u5230\u63a7\u5236\u53f0\u3002\u4f8b\u5982\uff0c<code>print(&quot;\u4f60\u597d\uff0c\u4e16\u754c\uff01&quot;)<\/code>\u5c06\u4f1a\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u201c\u4f60\u597d\uff0c\u4e16\u754c\uff01\u201d\u8fd9\u884c\u5b57\u3002\u60a8\u53ef\u4ee5\u5728\u51fd\u6570\u5185\u8f93\u5165\u4efb\u4f55\u5b57\u7b26\u4e32\uff0c\u5305\u62ec\u5e26\u6709\u7279\u6b8a\u5b57\u7b26\u7684\u6587\u672c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5199\u591a\u884c\u6587\u672c\uff1f<\/strong><br \/>\u5982\u679c\u9700\u8981\u8f93\u51fa\u591a\u884c\u6587\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e09\u91cd\u5f15\u53f7\uff08<code>&#39;&#39;&#39;<\/code>\u6216<code>&quot;&quot;&quot;<\/code>\uff09\u6765\u5b9a\u4e49\u591a\u884c\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">print(&quot;&quot;&quot;\u8fd9\u662f\u7b2c\u4e00\u884c\n\u8fd9\u662f\u7b2c\u4e8c\u884c\n\u8fd9\u662f\u7b2c\u4e09\u884c&quot;&quot;&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u60a8\u53ef\u4ee5\u5728\u4e00\u6761<code>print()<\/code>\u8bed\u53e5\u4e2d\u8f93\u51fa\u591a\u884c\u5185\u5bb9\uff0c\u4fdd\u6301\u4ee3\u7801\u7684\u6574\u6d01\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u5c06\u8f93\u51fa\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff1f<\/strong><br \/>\u4e3a\u4e86\u5c06\u6587\u672c\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\u3002\u9996\u5148\uff0c\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528<code>write()<\/code>\u65b9\u6cd5\u5199\u5165\u6587\u672c\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&quot;output.txt&quot;, &quot;w&quot;) as file:\n    file.write(&quot;\u8fd9\u662f\u8981\u4fdd\u5b58\u7684\u6587\u672c\u3002&quot;)\n<\/code><\/pre>\n<p>\u6267\u884c\u540e\uff0c\u6587\u672c\u5c06\u88ab\u5199\u5165\u540d\u4e3a<code>output.txt<\/code>\u7684\u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5728\u6587\u4ef6\u4e2d\u67e5\u770b\u4fdd\u5b58\u7684\u5185\u5bb9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u7528Python\u5199\u4e00\u884c\u5b57\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528print()\u51fd\u6570\u3001\u4f7f\u7528logging\u6a21\u5757\u3001\u5728\u6587\u4ef6\u4e2d\u5199\u5165\u6587\u672c\u7b49\u3002\u5176 [&hellip;]","protected":false},"author":3,"featured_media":1048163,"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\/1048157"}],"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=1048157"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1048157\/revisions"}],"predecessor-version":[{"id":1048168,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1048157\/revisions\/1048168"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1048163"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1048157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1048157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1048157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}