{"id":1023200,"date":"2024-12-30T14:03:00","date_gmt":"2024-12-30T06:03:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1023200.html"},"modified":"2024-12-30T14:03:02","modified_gmt":"2024-12-30T06:03:02","slug":"python%e5%a6%82%e4%bd%95%e8%87%aa%e5%8a%a8%e5%88%9b%e5%bb%ba%e5%8f%98%e9%87%8f-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1023200.html","title":{"rendered":"python\u5982\u4f55\u81ea\u52a8\u521b\u5efa\u53d8\u91cf"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/c497af85-10a1-497f-abb6-6759c92e7bfb.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u81ea\u52a8\u521b\u5efa\u53d8\u91cf\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u81ea\u52a8\u521b\u5efa\u53d8\u91cf\u7684\u51e0\u79cd\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528\u5b57\u5178\u3001\u4f7f\u7528exec\u51fd\u6570\u3001\u4f7f\u7528setattr\u51fd\u6570<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u5b57\u5178\u662f\u4e00\u79cd\u6700\u5e38\u7528\u4e14\u5b89\u5168\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u52a8\u6001\u5730\u5b58\u50a8\u548c\u8bbf\u95ee\u53d8\u91cf\u7684\u540d\u79f0\u548c\u503c\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u8fd9\u4e9b\u65b9\u6cd5\u53ca\u5176\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u5b57\u5178<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5b57\u5178\u662f\u4e00\u79cd\u975e\u5e38\u7075\u6d3b\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u7528\u6765\u5b58\u50a8\u952e\u503c\u5bf9\u3002\u4f7f\u7528\u5b57\u5178\u6765\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u975e\u5e38\u65b9\u4fbf\uff0c\u540c\u65f6\u4e5f\u662f\u6700\u63a8\u8350\u7684\u65b9\u5f0f\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u907f\u514d\u4e86\u76f4\u63a5\u64cd\u4f5c\u5168\u5c40\u547d\u540d\u7a7a\u95f4\u53ef\u80fd\u5e26\u6765\u7684\u98ce\u9669\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178<\/p>\n<p>variables = {}<\/p>\n<h2><strong>\u52a8\u6001\u6dfb\u52a0\u53d8\u91cf<\/strong><\/h2>\n<p>variables[&#39;var1&#39;] = 10<\/p>\n<p>variables[&#39;var2&#39;] = 20<\/p>\n<h2><strong>\u8bbf\u95ee\u53d8\u91cf<\/strong><\/h2>\n<p>print(variables[&#39;var1&#39;])  # \u8f93\u51fa: 10<\/p>\n<p>print(variables[&#39;var2&#39;])  # \u8f93\u51fa: 20<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u5730\u521b\u5efa\u3001\u7ba1\u7406\u548c\u8bbf\u95ee\u53d8\u91cf\uff0c\u4e14\u53d8\u91cf\u7684\u540d\u79f0\u548c\u6570\u91cf\u53ef\u4ee5\u52a8\u6001\u53d8\u5316\u3002\u4f7f\u7528\u5b57\u5178\u521b\u5efa\u53d8\u91cf\u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u7684\u5b89\u5168\u6027\u548c\u53ef\u63a7\u6027\uff0c\u4e0d\u4f1a\u6c61\u67d3\u5168\u5c40\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528exec\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>exec<\/code>\u51fd\u6570\u53ef\u4ee5\u6267\u884c\u50a8\u5b58\u5728\u5b57\u7b26\u4e32\u6216\u4ee3\u7801\u5bf9\u8c61\u4e2d\u7684Python\u4ee3\u7801\u3002\u901a\u8fc7<code>exec<\/code>\uff0c\u6211\u4eec\u53ef\u4ee5\u52a8\u6001\u5730\u521b\u5efa\u53d8\u91cf\u3002\u4e0d\u8fc7\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u63a8\u8350\u5e7f\u6cdb\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u5bfc\u81f4\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u964d\u4f4e\uff0c\u5e76\u4e14\u5b58\u5728\u5b89\u5168\u9690\u60a3\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u52a8\u6001\u521b\u5efa\u53d8\u91cf<\/p>\n<p>for i in range(5):<\/p>\n<p>    exec(f&#39;var{i} = {i}&#39;)<\/p>\n<h2><strong>\u8bbf\u95ee\u53d8\u91cf<\/strong><\/h2>\n<p>print(var0)  # \u8f93\u51fa: 0<\/p>\n<p>print(var1)  # \u8f93\u51fa: 1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>exec<\/code>\u51fd\u6570\u6267\u884c\u4e86\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u4ee3\u7801\uff0c\u4ece\u800c\u52a8\u6001\u521b\u5efa\u4e86\u53d8\u91cf<code>var0<\/code>\u5230<code>var4<\/code>\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u7075\u6d3b\uff0c\u4f46\u5e94\u8c28\u614e\u4f7f\u7528\uff0c\u7279\u522b\u662f\u5728\u5904\u7406\u7528\u6237\u8f93\u5165\u65f6\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528setattr\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>setattr<\/code>\u51fd\u6570\u53ef\u4ee5\u52a8\u6001\u5730\u4e3a\u5bf9\u8c61\u8bbe\u7f6e\u5c5e\u6027\u3002\u867d\u7136\u901a\u5e38\u7528\u4e8e\u7c7b\u5b9e\u4f8b\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6a21\u5757\u5bf9\u8c61\uff0c\u4ece\u800c\u5b9e\u73b0\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    pass<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b<\/strong><\/h2>\n<p>obj = MyClass()<\/p>\n<h2><strong>\u52a8\u6001\u6dfb\u52a0\u53d8\u91cf<\/strong><\/h2>\n<p>setattr(obj, &#39;var1&#39;, 10)<\/p>\n<p>setattr(obj, &#39;var2&#39;, 20)<\/p>\n<h2><strong>\u8bbf\u95ee\u53d8\u91cf<\/strong><\/h2>\n<p>print(obj.var1)  # \u8f93\u51fa: 10<\/p>\n<p>print(obj.var2)  # \u8f93\u51fa: 20<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u521b\u5efa\u4e86\u4e00\u4e2a\u7c7b<code>MyClass<\/code>\uff0c\u7136\u540e\u4e3a\u5176\u5b9e\u4f8b<code>obj<\/code>\u52a8\u6001\u6dfb\u52a0\u4e86\u5c5e\u6027<code>var1<\/code>\u548c<code>var2<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u5c06\u52a8\u6001\u521b\u5efa\u7684\u53d8\u91cf\u4e0e\u7279\u5b9a\u5bf9\u8c61\u5173\u8054\uff0c\u4ece\u800c\u907f\u514d\u5168\u5c40\u53d8\u91cf\u6c61\u67d3\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528globals()\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>globals<\/code>\u51fd\u6570\u8fd4\u56de\u5f53\u524d\u5168\u5c40\u7b26\u53f7\u8868\u7684\u5b57\u5178\u3002\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u8fd9\u4e2a\u5b57\u5178\u6765\u52a8\u6001\u521b\u5efa\u5168\u5c40\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u52a8\u6001\u521b\u5efa\u5168\u5c40\u53d8\u91cf<\/p>\n<p>for i in range(5):<\/p>\n<p>    globals()[f&#39;var{i}&#39;] = i<\/p>\n<h2><strong>\u8bbf\u95ee\u53d8\u91cf<\/strong><\/h2>\n<p>print(var0)  # \u8f93\u51fa: 0<\/p>\n<p>print(var1)  # \u8f93\u51fa: 1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u76f4\u63a5\uff0c\u4f46\u4e5f\u5b58\u5728\u4e00\u5b9a\u7684\u98ce\u9669\uff0c\u56e0\u4e3a\u5b83\u76f4\u63a5\u64cd\u4f5c\u5168\u5c40\u547d\u540d\u7a7a\u95f4\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u53d8\u91cf\u51b2\u7a81\u6216\u6c61\u67d3\u547d\u540d\u7a7a\u95f4\u3002\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u5e94\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528locals()\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>locals<\/code>\u51fd\u6570\u8fd4\u56de\u5f53\u524d\u5c40\u90e8\u7b26\u53f7\u8868\u7684\u5b57\u5178\u3002\u4e0e<code>globals<\/code>\u7c7b\u4f3c\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u8fd9\u4e2a\u5b57\u5178\u6765\u52a8\u6001\u521b\u5efa\u5c40\u90e8\u53d8\u91cf\u3002\u4e0d\u8fc7\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fee\u6539<code>locals<\/code>\u8fd4\u56de\u7684\u5b57\u5178\u5e76\u4e0d\u4f1a\u771f\u6b63\u6539\u53d8\u5c40\u90e8\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u52a8\u6001\u521b\u5efa\u5c40\u90e8\u53d8\u91cf<\/p>\n<p>def create_locals():<\/p>\n<p>    for i in range(5):<\/p>\n<p>        locals()[f&#39;var{i}&#39;] = i<\/p>\n<p>    # \u5c1d\u8bd5\u8bbf\u95ee\u53d8\u91cf<\/p>\n<p>    try:<\/p>\n<p>        print(var0)  # \u62a5\u9519\uff1aNameError: name &#39;var0&#39; is not defined<\/p>\n<p>    except NameError as e:<\/p>\n<p>        print(e)<\/p>\n<p>create_locals()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u867d\u7136\u6211\u4eec\u4fee\u6539\u4e86<code>locals<\/code>\u8fd4\u56de\u7684\u5b57\u5178\uff0c\u4f46\u5e76\u6ca1\u6709\u771f\u6b63\u521b\u5efa\u5c40\u90e8\u53d8\u91cf\u3002\u56e0\u6b64\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u5e76\u4e0d\u5e38\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528\u7c7b\u7684__dict__\u5c5e\u6027<\/h3>\n<\/p>\n<p><p>\u7c7b\u7684\u5b9e\u4f8b\u6709\u4e00\u4e2a<code>__dict__<\/code>\u5c5e\u6027\uff0c\u5b83\u662f\u4e00\u4e2a\u5b57\u5178\uff0c\u5305\u542b\u4e86\u5b9e\u4f8b\u7684\u6240\u6709\u5c5e\u6027\u3002\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u8fd9\u4e2a\u5b57\u5178\u6765\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    pass<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b<\/strong><\/h2>\n<p>obj = MyClass()<\/p>\n<h2><strong>\u52a8\u6001\u6dfb\u52a0\u53d8\u91cf<\/strong><\/h2>\n<p>obj.__dict__[&#39;var1&#39;] = 10<\/p>\n<p>obj.__dict__[&#39;var2&#39;] = 20<\/p>\n<h2><strong>\u8bbf\u95ee\u53d8\u91cf<\/strong><\/h2>\n<p>print(obj.var1)  # \u8f93\u51fa: 10<\/p>\n<p>print(obj.var2)  # \u8f93\u51fa: 20<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u901a\u8fc7\u4fee\u6539\u5b9e\u4f8b\u7684<code>__dict__<\/code>\u5c5e\u6027\u52a8\u6001\u6dfb\u52a0\u4e86\u53d8\u91cf\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0e\u4f7f\u7528<code>setattr<\/code>\u51fd\u6570\u7c7b\u4f3c\uff0c\u4f46\u76f4\u63a5\u64cd\u4f5c<code>__dict__<\/code>\u5c5e\u6027\u53ef\u80fd\u66f4\u52a0\u7075\u6d3b\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528\u5b57\u5178\u3001<code>exec<\/code>\u51fd\u6570\u3001<code>setattr<\/code>\u51fd\u6570\u3001<code>globals<\/code>\u51fd\u6570\u3001<code>locals<\/code>\u51fd\u6570\u548c\u7c7b\u7684<code>__dict__<\/code>\u5c5e\u6027\u3002\u5176\u4e2d\uff0c<strong>\u4f7f\u7528\u5b57\u5178<\/strong>\u662f\u6700\u63a8\u8350\u7684\u65b9\u5f0f\uff0c\u56e0\u4e3a\u5b83\u7075\u6d3b\u3001\u5b89\u5168\u4e14\u6613\u4e8e\u7ba1\u7406\u3002<strong>\u4f7f\u7528<code>exec<\/code>\u548c<code>globals<\/code>\u51fd\u6570<\/strong>\u867d\u7136\u975e\u5e38\u5f3a\u5927\uff0c\u4f46\u5e94\u8c28\u614e\u4f7f\u7528\uff0c\u4ee5\u907f\u514d\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u964d\u4f4e\u548c\u6f5c\u5728\u7684\u5b89\u5168\u9690\u60a3\u3002<strong>\u4f7f\u7528<code>setattr<\/code>\u51fd\u6570\u548c\u7c7b\u7684<code>__dict__<\/code>\u5c5e\u6027<\/strong>\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e3a\u5bf9\u8c61\u52a8\u6001\u6dfb\u52a0\u5c5e\u6027\uff0c\u9002\u5408\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p>\u603b\u4e4b\uff0c\u6839\u636e\u5177\u4f53\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u786e\u4fdd\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u5b89\u5168\u6027\uff0c\u662f\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u7684\u5173\u952e\u6240\u5728\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u540d\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>locals()<\/code>\u6216<code>globals()<\/code>\u51fd\u6570\u6765\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u3002\u8fd9\u4e9b\u51fd\u6570\u8fd4\u56de\u5f53\u524d\u7684\u5c40\u90e8\u6216\u5168\u5c40\u547d\u540d\u7a7a\u95f4\u7684\u5b57\u5178\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5b57\u5178\u7684\u65b9\u5f0f\u4e3a\u53d8\u91cf\u8d4b\u503c\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">variable_name = &#39;my_variable&#39;\nlocals()[variable_name] = 10\nprint(my_variable)  # \u8f93\u51fa 10\n<\/code><\/pre>\n<p>\u8bf7\u6ce8\u610f\uff0c\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u53ef\u80fd\u5bfc\u81f4\u4ee3\u7801\u53ef\u8bfb\u6027\u964d\u4f4e\uff0c\u5efa\u8bae\u4f7f\u7528\u5b57\u5178\u6216\u5217\u8868\u7b49\u6570\u636e\u7ed3\u6784\u6765\u7ba1\u7406\u76f8\u5173\u6570\u636e\u3002<\/p>\n<p><strong>\u4f7f\u7528\u5b57\u5178\u4ee3\u66ff\u52a8\u6001\u53d8\u91cf\u6709\u4ec0\u4e48\u597d\u5904\uff1f<\/strong><br \/>\u4f7f\u7528\u5b57\u5178\u6765\u4ee3\u66ff\u52a8\u6001\u521b\u5efa\u53d8\u91cf\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u548c\u6613\u4e8e\u7ef4\u62a4\u3002\u5b57\u5178\u5141\u8bb8\u4f60\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f\u5b58\u50a8\u6570\u636e\uff0c\u8bbf\u95ee\u548c\u4fee\u6539\u6570\u636e\u65f6\u4e5f\u66f4\u52a0\u76f4\u89c2\u3002\u6b64\u5916\uff0c\u901a\u8fc7\u5b57\u5178\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u8fed\u4ee3\u548c\u67e5\u8be2\uff0c\u5927\u5927\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u7ba1\u7406\u5927\u91cf\u52a8\u6001\u53d8\u91cf\u4ee5\u907f\u514d\u547d\u540d\u51b2\u7a81\uff1f<\/strong><br \/>\u5f53\u9700\u8981\u7ba1\u7406\u5927\u91cf\u52a8\u6001\u53d8\u91cf\u65f6\uff0c\u4f7f\u7528\u6570\u636e\u7ed3\u6784\u5982\u5217\u8868\u6216\u5b57\u5178\u662f\u4e00\u4e2a\u660e\u667a\u7684\u9009\u62e9\u3002\u901a\u8fc7\u5c06\u76f8\u5173\u6570\u636e\u7ec4\u7ec7\u5728\u4e00\u8d77\uff0c\u4f60\u53ef\u4ee5\u907f\u514d\u547d\u540d\u51b2\u7a81\u5e76\u63d0\u5347\u4ee3\u7801\u7684\u7ed3\u6784\u6027\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u5b57\u5178\u5c06\u6570\u636e\u5206\u7c7b\uff0c\u53ef\u4ee5\u901a\u8fc7\u952e\u503c\u5bf9\u5feb\u901f\u8bbf\u95ee\u548c\u7ba1\u7406\u53d8\u91cf\uff0c\u51cf\u5c11\u6f5c\u5728\u7684\u547d\u540d\u51b2\u7a81\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u81ea\u52a8\u521b\u5efa\u53d8\u91cf\u7684\u51e0\u79cd\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528\u5b57\u5178\u3001\u4f7f\u7528exec\u51fd\u6570\u3001\u4f7f\u7528setattr\u51fd\u6570\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u5b57\u5178\u662f [&hellip;]","protected":false},"author":3,"featured_media":1023205,"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\/1023200"}],"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=1023200"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1023200\/revisions"}],"predecessor-version":[{"id":1023208,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1023200\/revisions\/1023208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1023205"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1023200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1023200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1023200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}