{"id":1076604,"date":"2025-01-08T11:54:50","date_gmt":"2025-01-08T03:54:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1076604.html"},"modified":"2025-01-08T11:54:53","modified_gmt":"2025-01-08T03:54:53","slug":"python%e5%a6%82%e4%bd%95%e8%be%93%e5%87%ba%e5%a4%9a%e4%b8%aa%e6%95%b0%e6%8d%ae%e6%a0%bc%e5%bc%8f-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1076604.html","title":{"rendered":"python\u5982\u4f55\u8f93\u51fa\u591a\u4e2a\u6570\u636e\u683c\u5f0f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24181106\/efb146a0-057c-4334-a6f4-8bfe75f23659.webp\" alt=\"python\u5982\u4f55\u8f93\u51fa\u591a\u4e2a\u6570\u636e\u683c\u5f0f\" \/><\/p>\n<p><p> Python\u8f93\u51fa\u591a\u4e2a\u6570\u636e\u683c\u5f0f\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001f-strings\u548cformat()\u51fd\u6570\u7b49\u3002<strong>\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u5982\u767e\u5206\u53f7\u683c\u5f0f\u5316\u3001str.format()\u65b9\u6cd5\u3001f-strings\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u8fde\u63a5\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982PrettyTable\u548cPandas\u7b49<\/strong>\u3002\u5176\u4e2d\uff0cf-strings\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u65b0\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u5177\u6709\u7b80\u6d01\u3001\u6613\u8bfb\u3001\u529f\u80fd\u5f3a\u5927\u7684\u7279\u70b9\u3002\u4ee5\u4e0b\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u53ca\u5176\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u767e\u5206\u53f7\u683c\u5f0f\u5316<\/h3>\n<\/p>\n<p><p>\u767e\u5206\u53f7\u683c\u5f0f\u5316\u662fPython\u4e2d\u8f83\u65e9\u7684\u4e00\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u4f7f\u7528\u767e\u5206\u53f7\uff08%\uff09\u4f5c\u4e3a\u5360\u4f4d\u7b26\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u5728Python 3.x\u4e2d\u4ecd\u7136\u652f\u6301\uff0c\u4f46\u4e0d\u63a8\u8350\u5728\u65b0\u4ee3\u7801\u4e2d\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u4e0d\u5982\u5176\u4ed6\u65b9\u6cd5\u76f4\u89c2\u548c\u7075\u6d3b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Alice&quot;<\/p>\n<p>age = 30<\/p>\n<p>print(&quot;Name: %s, Age: %d&quot; % (name, age))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001str.format()\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>str.format()<\/code>\u65b9\u6cd5\u662f\u5728Python 2.7\u548c3.0\u4e2d\u5f15\u5165\u7684\uff0c\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u683c\u5f0f\u5316\u529f\u80fd\u3002\u5b83\u4f7f\u7528\u82b1\u62ec\u53f7 <code>{}<\/code> \u4f5c\u4e3a\u5360\u4f4d\u7b26\uff0c\u5e76\u901a\u8fc7 <code>format()<\/code> \u65b9\u6cd5\u4f20\u9012\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Bob&quot;<\/p>\n<p>age = 25<\/p>\n<p>print(&quot;Name: {}, Age: {}&quot;.format(name, age))<\/p>\n<h2><strong>\u6307\u5b9a\u4f4d\u7f6e\u53c2\u6570<\/strong><\/h2>\n<p>print(&quot;Name: {0}, Age: {1}&quot;.format(name, age))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001f-strings<\/h3>\n<\/p>\n<p><p>f-strings\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u65b0\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u5177\u6709\u7b80\u6d01\u3001\u6613\u8bfb\u3001\u529f\u80fd\u5f3a\u5927\u7684\u7279\u70b9\u3002\u5b83\u4f7f\u7528\u5b57\u6bcd <code>f<\/code> \u6216 <code>F<\/code> \u4f5c\u4e3a\u524d\u7f00\uff0c\u82b1\u62ec\u53f7 <code>{}<\/code> \u4e2d\u7684\u53d8\u91cf\u540d\u6216\u8868\u8fbe\u5f0f\u4f1a\u88ab\u66ff\u6362\u4e3a\u76f8\u5e94\u7684\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Charlie&quot;<\/p>\n<p>age = 20<\/p>\n<p>print(f&quot;Name: {name}, Age: {age}&quot;)<\/p>\n<h2><strong>\u8fd8\u53ef\u4ee5\u5728\u82b1\u62ec\u53f7\u5185\u8fdb\u884c\u8868\u8fbe\u5f0f\u8ba1\u7b97<\/strong><\/h2>\n<p>print(f&quot;Next year, {name} will be {age + 1}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5b57\u7b26\u4e32\u8fde\u63a5<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u5b57\u7b26\u4e32\u8fde\u63a5\uff0c\u53ef\u4ee5\u5c06\u591a\u4e2a\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u540e\u62fc\u63a5\u5728\u4e00\u8d77\u3002\u8fd9\u79cd\u65b9\u6cd5\u867d\u7136\u7b80\u5355\uff0c\u4f46\u4e0d\u5982\u524d\u9762\u51e0\u79cd\u65b9\u6cd5\u76f4\u89c2\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Dave&quot;<\/p>\n<p>age = 35<\/p>\n<p>print(&quot;Name: &quot; + name + &quot;, Age: &quot; + str(age))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u7b2c\u4e09\u65b9\u5e93<\/h3>\n<\/p>\n<p><h4>1\u3001PrettyTable<\/h4>\n<\/p>\n<p><p>PrettyTable\u662f\u4e00\u4e2a\u7528\u4e8e\u751f\u6210\u7f8e\u89c2ASCII\u8868\u683c\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u9002\u7528\u4e8e\u9700\u8981\u8f93\u51fa\u8868\u683c\u6570\u636e\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from prettytable import PrettyTable<\/p>\n<p>table = PrettyTable()<\/p>\n<p>table.field_names = [&quot;Name&quot;, &quot;Age&quot;]<\/p>\n<p>table.add_row([&quot;Eve&quot;, 40])<\/p>\n<p>table.add_row([&quot;Frank&quot;, 28])<\/p>\n<p>print(table)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001Pandas<\/h4>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u5e93\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5904\u7406\u548c\u8f93\u51fa\u590d\u6742\u6570\u636e\u7684\u60c5\u51b5\u3002\u5b83\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u6570\u636e\u8f93\u51fa\u4e3a\u5404\u79cd\u683c\u5f0f\uff0c\u5982\u8868\u683c\u3001CSV\u3001Excel\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>data = {&quot;Name&quot;: [&quot;Grace&quot;, &quot;Hank&quot;], &quot;Age&quot;: [45, 33]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>print(df)<\/p>\n<h2><strong>\u8f93\u51fa\u4e3aCSV\u683c\u5f0f<\/strong><\/h2>\n<p>df.to_csv(&quot;output.csv&quot;, index=False)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u8f93\u51fa\u5176\u4ed6\u6570\u636e\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\uff0cPython\u8fd8\u652f\u6301\u8f93\u51fa\u5176\u4ed6\u6570\u636e\u683c\u5f0f\uff0c\u5982JSON\u3001XML\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1\u3001JSON<\/h4>\n<\/p>\n<p><p>JSON\uff08JavaScript Object Notation\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f\uff0cPython\u5185\u7f6e\u7684 <code>json<\/code> \u6a21\u5757\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884cJSON\u6570\u636e\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import json<\/p>\n<p>data = {&quot;name&quot;: &quot;Ivy&quot;, &quot;age&quot;: 29}<\/p>\n<p>json_data = json.dumps(data)<\/p>\n<p>print(json_data)<\/p>\n<h2><strong>\u4eceJSON\u5b57\u7b26\u4e32\u52a0\u8f7d\u6570\u636e<\/strong><\/h2>\n<p>loaded_data = json.loads(json_data)<\/p>\n<p>print(loaded_data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001XML<\/h4>\n<\/p>\n<p><p>XML\uff08eXtensible Markup Language\uff09\u662f\u4e00\u79cd\u5e38\u7528\u4e8e\u6570\u636e\u4ea4\u6362\u7684\u6807\u8bb0\u8bed\u8a00\uff0cPython\u6709\u591a\u4e2a\u5e93\u53ef\u4ee5\u5904\u7406XML\u6570\u636e\uff0c\u5982 <code>xml.etree.ElementTree<\/code> \u548c <code>lxml<\/code>\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.etree.ElementTree as ET<\/p>\n<p>root = ET.Element(&quot;person&quot;)<\/p>\n<p>name = ET.SubElement(root, &quot;name&quot;)<\/p>\n<p>name.text = &quot;Jack&quot;<\/p>\n<p>age = ET.SubElement(root, &quot;age&quot;)<\/p>\n<p>age.text = &quot;50&quot;<\/p>\n<p>tree = ET.ElementTree(root)<\/p>\n<p>tree.write(&quot;output.xml&quot;)<\/p>\n<h2><strong>\u8bfb\u53d6XML\u6570\u636e<\/strong><\/h2>\n<p>tree = ET.parse(&quot;output.xml&quot;)<\/p>\n<p>root = tree.getroot()<\/p>\n<p>print(f&quot;Name: {root.find(&#39;name&#39;).text}, Age: {root.find(&#39;age&#39;).text}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u8f93\u51fa\u4e3a\u8868\u683c<\/h3>\n<\/p>\n<p><h4>1\u3001tabulate<\/h4>\n<\/p>\n<p><p><code>tabulate<\/code> \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5e93\uff0c\u53ef\u4ee5\u5c06\u5217\u8868\u6216\u5b57\u5178\u6570\u636e\u683c\u5f0f\u5316\u4e3a\u8868\u683c\u5f62\u5f0f\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from tabulate import tabulate<\/p>\n<p>data = [[&quot;Alice&quot;, 30], [&quot;Bob&quot;, 25], [&quot;Charlie&quot;, 20]]<\/p>\n<p>print(tabulate(data, headers=[&quot;Name&quot;, &quot;Age&quot;], tablefmt=&quot;grid&quot;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001texttable<\/h4>\n<\/p>\n<p><p><code>texttable<\/code> \u662f\u53e6\u4e00\u4e2a\u7528\u4e8e\u751f\u6210\u8868\u683c\u7684\u5e93\uff0c\u652f\u6301\u5bf9\u9f50\u3001\u8fb9\u6846\u3001\u6807\u9898\u7b49\u591a\u79cd\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from texttable import Texttable<\/p>\n<p>table = Texttable()<\/p>\n<p>table.add_rows([[&quot;Name&quot;, &quot;Age&quot;], [&quot;Dave&quot;, 35], [&quot;Eve&quot;, 40]])<\/p>\n<p>print(table.draw())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u8f93\u51fa\u4e3aHTML<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u8f93\u51faHTML\u683c\u5f0f\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>html<\/code> \u6a21\u5757\u6216\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982 <code>jinja2<\/code>\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528html\u6a21\u5757\u751f\u6210\u7b80\u5355\u7684HTML<\/p>\n<p>from html import escape<\/p>\n<p>name = &quot;Frank&quot;<\/p>\n<p>age = 28<\/p>\n<p>html_content = f&quot;&lt;html&gt;&lt;body&gt;&lt;p&gt;Name: {escape(name)}, Age: {age}&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;&quot;<\/p>\n<p>print(html_content)<\/p>\n<h2><strong>\u4f7f\u7528jinja2\u6a21\u677f\u5f15\u64ce\u751f\u6210\u590d\u6742\u7684HTML<\/strong><\/h2>\n<p>from jinja2 import Template<\/p>\n<p>template = Template(&quot;&lt;html&gt;&lt;body&gt;&lt;p&gt;Name: {{ name }}, Age: {{ age }}&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;&quot;)<\/p>\n<p>html_content = template.render(name=&quot;Grace&quot;, age=45)<\/p>\n<p>print(html_content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e5d\u3001\u8f93\u51fa\u4e3aMarkdown<\/h3>\n<\/p>\n<p><p>Markdown\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u6807\u8bb0\u8bed\u8a00\uff0c\u9002\u7528\u4e8e\u751f\u6210\u6587\u6863\u3001\u535a\u5ba2\u7b49\u5185\u5bb9\u3002\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u5b57\u7b26\u4e32\u64cd\u4f5c\u751f\u6210Markdown\u683c\u5f0f\u6570\u636e\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982 <code>mistune<\/code>\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u751f\u6210\u7b80\u5355\u7684Markdown<\/p>\n<p>name = &quot;Hank&quot;<\/p>\n<p>age = 33<\/p>\n<p>markdown_content = f&quot;# Person\\n\\n- &lt;strong&gt;Name&lt;\/strong&gt;: {name}\\n- &lt;strong&gt;Age&lt;\/strong&gt;: {age}&quot;<\/p>\n<p>print(markdown_content)<\/p>\n<h2><strong>\u4f7f\u7528mistune\u5e93\u751f\u6210\u590d\u6742\u7684Markdown<\/strong><\/h2>\n<p>import mistune<\/p>\n<p>markdown = mistune.create_markdown()<\/p>\n<p>data = {&quot;name&quot;: &quot;Ivy&quot;, &quot;age&quot;: 29}<\/p>\n<p>markdown_content = f&quot;# Person\\n\\n- &lt;strong&gt;Name&lt;\/strong&gt;: {data[&#39;name&#39;]}\\n- &lt;strong&gt;Age&lt;\/strong&gt;: {data[&#39;age&#39;]}&quot;<\/p>\n<p>html_content = markdown(markdown_content)<\/p>\n<p>print(html_content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u8f93\u51faPython\u4e2d\u7684\u591a\u79cd\u6570\u636e\u683c\u5f0f\uff0c\u6ee1\u8db3\u4e0d\u540c\u573a\u666f\u7684\u9700\u6c42\u3002\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8f93\u51fa\u4e0d\u540c\u6570\u636e\u7c7b\u578b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>print()<\/code>\u51fd\u6570\u6765\u8f93\u51fa\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5982\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u5217\u8868\u3001\u5b57\u5178\u7b49\u3002\u901a\u8fc7\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001f-string\u6216\u4f7f\u7528<code>str.format()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u63a7\u5236\u8f93\u51fa\u683c\u5f0f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528f-string\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5728\u5b57\u7b26\u4e32\u4e2d\u63d2\u5165\u53d8\u91cf\u503c\uff0c\u63d0\u4f9b\u66f4\u6e05\u6670\u7684\u8f93\u51fa\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u683c\u5f0f\u5316\u8f93\u51fa\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u683c\u5f0f\u5316\u8f93\u51fa\u7684\u65b9\u5f0f\uff0c\u5305\u62ec\u4f7f\u7528<code>%<\/code>\u64cd\u4f5c\u7b26\u3001<code>str.format()<\/code>\u65b9\u6cd5\u548cf-string\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5141\u8bb8\u7528\u6237\u6307\u5b9a\u8f93\u51fa\u7684\u7cbe\u5ea6\u3001\u5bbd\u5ea6\u548c\u5bf9\u9f50\u65b9\u5f0f\uff0c\u4ece\u800c\u4f7f\u8f93\u51fa\u66f4\u52a0\u7f8e\u89c2\u3002\u4f8b\u5982\uff0c\u4f7f\u7528f-string\u53ef\u4ee5\u8f7b\u677e\u5730\u8bbe\u7f6e\u6d6e\u70b9\u6570\u7684\u5c0f\u6570\u4f4d\u6570\uff0c\u589e\u52a0\u4e86\u8f93\u51fa\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u8f93\u51fa\u5217\u8868\u6216\u5b57\u5178\u7684\u5185\u5bb9\uff1f<\/strong><br \/>\u8981\u8f93\u51fa\u5217\u8868\u6216\u5b57\u5178\u7684\u5185\u5bb9\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u8f93\u51fa\uff0c\u4f7f\u7528<code>json<\/code>\u6a21\u5757\u4e2d\u7684<code>dumps()<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u5b57\u5178\u683c\u5f0f\u5316\u4e3aJSON\u5b57\u7b26\u4e32\uff0c\u4f7f\u5176\u66f4\u6613\u4e8e\u9605\u8bfb\u3002\u6b64\u5916\uff0c\u5faa\u73af\u904d\u5386\u5217\u8868\u6216\u5b57\u5178\u7684\u5143\u7d20\u53ef\u4ee5\u5b9e\u73b0\u9010\u4e2a\u8f93\u51fa\uff0c\u63d0\u4f9b\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8f93\u51fa\u591a\u4e2a\u6570\u636e\u683c\u5f0f\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001f-strings\u548cformat()\u51fd\u6570\u7b49\u3002\u53ef\u4ee5\u4f7f\u7528\u4e0d [&hellip;]","protected":false},"author":3,"featured_media":1076616,"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\/1076604"}],"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=1076604"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1076604\/revisions"}],"predecessor-version":[{"id":1076617,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1076604\/revisions\/1076617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1076616"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1076604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1076604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1076604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}