{"id":1029709,"date":"2024-12-31T11:10:50","date_gmt":"2024-12-31T03:10:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1029709.html"},"modified":"2024-12-31T11:10:53","modified_gmt":"2024-12-31T03:10:53","slug":"python%e5%a6%82%e4%bd%95%e8%be%93%e5%87%ba%e7%bb%93%e6%9e%9c%e5%88%b0%e6%8e%a7%e5%88%b6%e5%8f%b0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1029709.html","title":{"rendered":"python\u5982\u4f55\u8f93\u51fa\u7ed3\u679c\u5230\u63a7\u5236\u53f0"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/178ae897-a6ee-4c84-b564-4da7dda42dab.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u8f93\u51fa\u7ed3\u679c\u5230\u63a7\u5236\u53f0\" \/><\/p>\n<p><p> <strong>Python\u8f93\u51fa\u7ed3\u679c\u5230\u63a7\u5236\u53f0\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528print()\u51fd\u6570\u3001\u4f7f\u7528sys\u6a21\u5757\u3001\u4f7f\u7528logging\u6a21\u5757\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u7f3a\u70b9\uff0c\u5177\u4f53\u4f7f\u7528\u8981\u6839\u636e\u9700\u6c42\u6765\u9009\u62e9\u3002<\/strong><br \/>\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u51e0\u79cd\u65b9\u6cd5\u4e2d\u7684\u4e00\u79cd\uff0c\u5373print()\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><p>print()\u51fd\u6570\u662fPython\u4e2d\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u8f93\u51fa\u65b9\u6cd5\u3002\u5b83\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u3001\u53d8\u91cf\u3001\u8868\u8fbe\u5f0f\u7b49\u5185\u5bb9\u8f93\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u5e76\u4e14\u652f\u6301\u591a\u79cd\u683c\u5f0f\u5316\u65b9\u5f0f\u3002\u4f7f\u7528print()\u51fd\u6570\u8f93\u51fa\u7ed3\u679c\u7684\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(value, ..., sep=&#39; &#39;, end=&#39;\\n&#39;, file=sys.stdout, flush=False)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>value, ...<\/code>\uff1a\u8981\u8f93\u51fa\u7684\u503c\uff0c\u53ef\u4ee5\u662f\u591a\u4e2a\uff0c\u4e4b\u95f4\u7528\u9017\u53f7\u5206\u9694\u3002<\/li>\n<li><code>sep<\/code>\uff1a\u591a\u4e2a\u503c\u4e4b\u95f4\u7684\u5206\u9694\u7b26\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\u683c\u3002<\/li>\n<li><code>end<\/code>\uff1a\u8f93\u51fa\u7ed3\u675f\u65f6\u7684\u5b57\u7b26\uff0c\u9ed8\u8ba4\u4e3a\u6362\u884c\u7b26\u3002<\/li>\n<li><code>file<\/code>\uff1a\u8f93\u51fa\u7684\u76ee\u6807\u6587\u4ef6\u5bf9\u8c61\uff0c\u9ed8\u8ba4\u4e3asys.stdout\uff0c\u5373\u63a7\u5236\u53f0\u3002<\/li>\n<li><code>flush<\/code>\uff1a\u662f\u5426\u7acb\u5373\u5237\u65b0\u8f93\u51fa\u7f13\u51b2\u533a\uff0c\u9ed8\u8ba4\u4e3aFalse\u3002<\/li>\n<\/ul>\n<p><h3>\u4e00\u3001PRINT()\u51fd\u6570\u7684\u57fa\u672c\u4f7f\u7528\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>print()\u51fd\u6570\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u8f93\u51fa\u51fd\u6570\uff0c\u7528\u6765\u5c06\u5185\u5bb9\u6253\u5370\u5230\u63a7\u5236\u53f0\u3002\u5b83\u7684\u57fa\u672c\u7528\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5c06\u8981\u8f93\u51fa\u7684\u5185\u5bb9\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9print()\u51fd\u6570\u5373\u53ef\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f93\u51fa\u5b57\u7b26\u4e32<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u6574\u6570<\/strong><\/h2>\n<p>print(123)<\/p>\n<h2><strong>\u8f93\u51fa\u6d6e\u70b9\u6570<\/strong><\/h2>\n<p>print(3.14)<\/p>\n<h2><strong>\u8f93\u51fa\u591a\u4e2a\u503c\uff0c\u4e2d\u95f4\u7528\u7a7a\u683c\u5206\u9694<\/strong><\/h2>\n<p>print(&quot;The value of x is&quot;, 42)<\/p>\n<h2><strong>\u4f7f\u7528\u683c\u5f0f\u5316\u8f93\u51fa<\/strong><\/h2>\n<p>name = &quot;Alice&quot;<\/p>\n<p>age = 30<\/p>\n<p>print(f&quot;{name} is {age} years old.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001PRINT()\u51fd\u6570\u7684\u53c2\u6570\u8be6\u89e3<\/h3>\n<\/p>\n<p><p>print()\u51fd\u6570\u6709\u591a\u4e2a\u53ef\u9009\u53c2\u6570\uff0c\u53ef\u4ee5\u7528\u6765\u63a7\u5236\u8f93\u51fa\u7684\u683c\u5f0f\u548c\u884c\u4e3a\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u53c2\u6570\u7684\u7528\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1\u3001SEP\u53c2\u6570<\/h4>\n<\/p>\n<p><p><code>sep<\/code>\u53c2\u6570\u7528\u6765\u6307\u5b9a\u591a\u4e2a\u503c\u4e4b\u95f4\u7684\u5206\u9694\u7b26\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\u683c\u3002\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u9ed8\u8ba4\u7684\u7a7a\u683c\u5206\u9694\u7b26<\/p>\n<p>print(&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;)<\/p>\n<h2><strong>\u4f7f\u7528\u9017\u53f7\u5206\u9694\u7b26<\/strong><\/h2>\n<p>print(&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, sep=&quot;, &quot;)<\/p>\n<h2><strong>\u4f7f\u7528\u6362\u884c\u7b26\u5206\u9694<\/strong><\/h2>\n<p>print(&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, sep=&quot;\\n&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001END\u53c2\u6570<\/h4>\n<\/p>\n<p><p><code>end<\/code>\u53c2\u6570\u7528\u6765\u6307\u5b9a\u8f93\u51fa\u7ed3\u675f\u65f6\u7684\u5b57\u7b26\uff0c\u9ed8\u8ba4\u4e3a\u6362\u884c\u7b26\u3002\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u9ed8\u8ba4\u7684\u6362\u884c\u7b26\u7ed3\u675f<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<h2><strong>\u4f7f\u7528\u7a7a\u683c\u7ed3\u675f<\/strong><\/h2>\n<p>print(&quot;Hello, World!&quot;, end=&quot; &quot;)<\/p>\n<h2><strong>\u4f7f\u7528\u53e5\u53f7\u7ed3\u675f<\/strong><\/h2>\n<p>print(&quot;Hello, World!&quot;, end=&quot;.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001FILE\u53c2\u6570<\/h4>\n<\/p>\n<p><p><code>file<\/code>\u53c2\u6570\u7528\u6765\u6307\u5b9a\u8f93\u51fa\u7684\u76ee\u6807\u6587\u4ef6\u5bf9\u8c61\uff0c\u9ed8\u8ba4\u4e3asys.stdout\uff0c\u5373\u63a7\u5236\u53f0\u3002\u53ef\u4ee5\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u6587\u4ef6\u5bf9\u8c61\uff0c\u5b9e\u73b0\u8f93\u51fa\u91cd\u5b9a\u5411\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f93\u51fa\u5230\u63a7\u5236\u53f0<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u5230\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&quot;output.txt&quot;, &quot;w&quot;) as f:<\/p>\n<p>    print(&quot;Hello, World!&quot;, file=f)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001FLUSH\u53c2\u6570<\/h4>\n<\/p>\n<p><p><code>flush<\/code>\u53c2\u6570\u7528\u6765\u6307\u5b9a\u662f\u5426\u7acb\u5373\u5237\u65b0\u8f93\u51fa\u7f13\u51b2\u533a\uff0c\u9ed8\u8ba4\u4e3aFalse\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff08\u5982\u5b9e\u65f6\u8f93\u51fa\u65e5\u5fd7\uff09\uff0c\u53ef\u4ee5\u5c06\u5176\u8bbe\u7f6e\u4e3aTrue\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4e0d\u7acb\u5373\u5237\u65b0\u7f13\u51b2\u533a<\/p>\n<p>print(&quot;Hello, World!&quot;, flush=False)<\/p>\n<h2><strong>\u7acb\u5373\u5237\u65b0\u7f13\u51b2\u533a<\/strong><\/h2>\n<p>print(&quot;Hello, World!&quot;, flush=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u683c\u5f0f\u5316\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5e38\u5e38\u9700\u8981\u5c06\u53d8\u91cf\u7684\u503c\u5d4c\u5165\u5230\u8f93\u51fa\u5b57\u7b26\u4e32\u4e2d\uff0cPython\u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528\u767e\u5206\u53f7\uff08%\uff09\u8fdb\u884c\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7c7b\u4f3c\u4e8eC\u8bed\u8a00\u7684printf\u51fd\u6570\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;%s is %d years old.&quot; % (name, age))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528str.format()\u65b9\u6cd5\u8fdb\u884c\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u66f4\u7075\u6d3b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5927\u62ec\u53f7\uff08{}\uff09\u4f5c\u4e3a\u5360\u4f4d\u7b26\uff0c\u5e76\u5728\u540e\u9762\u4f7f\u7528format\u65b9\u6cd5\u4f20\u5165\u503c\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;{} is {} years old.&quot;.format(name, age))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528f\u5b57\u7b26\u4e32\uff08f-string\uff09\u8fdb\u884c\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p>\u8fd9\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u65b0\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u4f7f\u7528f\u5b57\u7b26\u4e32\u66f4\u52a0\u7b80\u6d01\u9ad8\u6548\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">name = &quot;Alice&quot;<\/p>\n<p>age = 30<\/p>\n<p>print(f&quot;{name} is {age} years old.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528SYS\u6a21\u5757\u8fdb\u884c\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>\u9664\u4e86print()\u51fd\u6570\uff0cPython\u8fd8\u63d0\u4f9b\u4e86sys\u6a21\u5757\u4e2d\u7684stdout\u548cstderr\u5bf9\u8c61\uff0c\u7528\u6765\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u8f93\u51fa\u63a7\u5236\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<h2><strong>\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa<\/strong><\/h2>\n<p>sys.stdout.write(&quot;Hello, World!\\n&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u5230\u6807\u51c6\u9519\u8bef<\/strong><\/h2>\n<p>sys.stderr.write(&quot;An error occurred.\\n&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528LOGGING\u6a21\u5757\u8fdb\u884c\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5c24\u5176\u662f\u5728\u7f16\u5199\u5927\u578b\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u65e5\u5fd7\u8bb0\u5f55\u7cfb\u7edf\u6765\u8f93\u51fa\u5404\u79cd\u4fe1\u606f\u3002Python\u7684logging\u6a21\u5757\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import logging<\/p>\n<h2><strong>\u914d\u7f6e\u65e5\u5fd7\u8bb0\u5f55\u5668<\/strong><\/h2>\n<p>logging.basicConfig(level=logging.INFO)<\/p>\n<h2><strong>\u8f93\u51fa\u4fe1\u606f<\/strong><\/h2>\n<p>logging.info(&quot;This is an info message.&quot;)<\/p>\n<p>logging.warning(&quot;This is a warning message.&quot;)<\/p>\n<p>logging.error(&quot;This is an error message.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u8f93\u51fa\u7ed3\u679c\u5230\u63a7\u5236\u53f0\u7684\u65b9\u6cd5\uff0c\u4e3b\u8981\u5305\u62ecprint()\u51fd\u6570\u3001sys\u6a21\u5757\u548clogging\u6a21\u5757\u3002<strong>print()\u51fd\u6570\u662f\u6700\u57fa\u7840\u3001\u6700\u5e38\u7528\u7684\u8f93\u51fa\u65b9\u6cd5\uff0c\u5177\u6709\u7b80\u5355\u3001\u7075\u6d3b\u7684\u7279\u70b9<\/strong>\uff1bsys\u6a21\u5757\u4e2d\u7684stdout\u548cstderr\u5bf9\u8c61\u53ef\u4ee5\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u8f93\u51fa\u63a7\u5236\uff1blogging\u6a21\u5757\u5219\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\uff0c\u9002\u7528\u4e8e\u5927\u578b\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5e94\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u8f93\u51fa\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u6253\u5370\u6587\u672c\u5230\u63a7\u5236\u53f0\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u5c06\u6587\u672c\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u53ea\u9700\u5728<code>print()<\/code>\u51fd\u6570\u7684\u62ec\u53f7\u5185\u653e\u5165\u4f60\u60f3\u8981\u663e\u793a\u7684\u5185\u5bb9\uff0c\u4f8b\u5982\uff1a<code>print(&quot;Hello, World!&quot;)<\/code>\u3002\u8fd9\u5c06\u628a\u201cHello, World!\u201d\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u4f60\u53ef\u4ee5\u8f93\u51fa\u5b57\u7b26\u4e32\u3001\u6570\u5b57\uff0c\u751a\u81f3\u662f\u53d8\u91cf\u7684\u503c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u683c\u5f0f\u5316\u8f93\u51fa\u7ed3\u679c\uff1f<\/strong><br \/>\u4e3a\u4e86\u4f7f\u8f93\u51fa\u7ed3\u679c\u66f4\u5177\u53ef\u8bfb\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u6bd4\u5982\u4f7f\u7528f-string\uff08\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\uff09\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<code>name = &quot;Alice&quot;; age = 30; print(f&quot;{name} is {age} years old.&quot;)<\/code>\u3002\u8fd9\u6837\u53ef\u4ee5\u5728\u8f93\u51fa\u4e2d\u5d4c\u5165\u53d8\u91cf\u7684\u503c\uff0c\u751f\u6210\u66f4\u590d\u6742\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u8f93\u51fa\u8c03\u8bd5\u4fe1\u606f\u5230\u63a7\u5236\u53f0\uff1f<\/strong><br \/>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u8c03\u8bd5\u4fe1\u606f\u7684\u8f93\u51fa\u975e\u5e38\u91cd\u8981\u3002\u9664\u4e86\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>logging<\/code>\u6a21\u5757\u6765\u8f93\u51fa\u8c03\u8bd5\u4fe1\u606f\u3002\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u65e5\u5fd7\u7ea7\u522b\uff08\u5982DEBUG\u3001INFO\u3001WARNING\u7b49\uff09\uff0c\u4f60\u53ef\u4ee5\u63a7\u5236\u8f93\u51fa\u7684\u8be6\u7ec6\u7a0b\u5ea6\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">import logging\nlogging.basicConfig(level=logging.DEBUG)\nlogging.debug(&quot;This is a debug message.&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u80fd\u8f93\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u8fd8\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u65e5\u5fd7\u4fe1\u606f\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u4fbf\u4e8e\u540e\u7eed\u67e5\u770b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8f93\u51fa\u7ed3\u679c\u5230\u63a7\u5236\u53f0\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528print()\u51fd\u6570\u3001\u4f7f\u7528sys\u6a21\u5757\u3001\u4f7f\u7528logging\u6a21 [&hellip;]","protected":false},"author":3,"featured_media":1029720,"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\/1029709"}],"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=1029709"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1029709\/revisions"}],"predecessor-version":[{"id":1029722,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1029709\/revisions\/1029722"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1029720"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1029709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1029709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1029709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}