{"id":936592,"date":"2024-12-26T19:31:18","date_gmt":"2024-12-26T11:31:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/936592.html"},"modified":"2024-12-26T19:31:21","modified_gmt":"2024-12-26T11:31:21","slug":"python-%e5%a6%82%e4%bd%95%e6%89%93%e5%87%bahello","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/936592.html","title":{"rendered":"python \u5982\u4f55\u6253\u51fahello"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072755\/ce6113f8-cac5-4a44-bb8e-f34af39abfbe.webp\" alt=\"python \u5982\u4f55\u6253\u51fahello\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u6253\u51fa\u201chello\u201d\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u6838\u5fc3\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528print\u51fd\u6570\u3001\u4f7f\u7528sys\u6a21\u5757\u3001\u901a\u8fc7\u6587\u4ef6\u8f93\u51fa\u7b49\u3002<\/strong> \u5176\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Python\u7684\u5185\u7f6e\u51fd\u6570<code>print()<\/code>\u3002\u901a\u8fc7\u8c03\u7528<code>print(&#39;hello&#39;)<\/code>\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u201chello\u201d\u3002\u8fd9\u662f\u56e0\u4e3a<code>print()<\/code>\u51fd\u6570\u662fPython\u4e2d\u6700\u57fa\u7840\u7684\u8f93\u51fa\u529f\u80fd\uff0c\u80fd\u591f\u5c06\u5b57\u7b26\u4e32\u6216\u8005\u5176\u4ed6\u6570\u636e\u7c7b\u578b\u76f4\u63a5\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u8bbe\u5907\uff08\u901a\u5e38\u662f\u5c4f\u5e55\uff09\u3002\u6b64\u5916\uff0cPython\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>sys.stdout<\/code>\u8fdb\u884c\u66f4\u7075\u6d3b\u7684\u8f93\u51fa\u64cd\u4f5c\uff0c\u6216\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\u4e2d\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u548c\u5b83\u4eec\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528PRINT\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>print()<\/code>\u51fd\u6570\u662fPython\u4e2d\u6700\u7b80\u5355\u76f4\u63a5\u7684\u8f93\u51fa\u65b9\u6cd5\u3002\u901a\u8fc7\u4f20\u9012\u53c2\u6570\u7ed9<code>print()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u8f7b\u677e\u6253\u5370\u4efb\u4f55\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u53ea\u9700\u4e00\u884c\u4ee3\u7801\u5373\u53ef\u6253\u5370\u201chello\u201d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&#39;hello&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u884c\u4ee3\u7801\u8c03\u7528\u4e86<code>print()<\/code>\u51fd\u6570\uff0c\u4f20\u5165\u4e86\u5b57\u7b26\u4e32<code>&#39;hello&#39;<\/code>\uff0c\u51fd\u6570\u4f1a\u5c06\u5b57\u7b26\u4e32\u5185\u5bb9\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><h4>2. \u591a\u53c2\u6570\u8f93\u51fa<\/h4>\n<\/p>\n<p><p><code>print()<\/code>\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u591a\u4e2a\u53c2\u6570\uff0c\u5e76\u5728\u8f93\u51fa\u65f6\u81ea\u52a8\u6dfb\u52a0\u7a7a\u683c\u5206\u9694\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&#39;hello&#39;, &#39;world&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u4f1a\u8f93\u51fa<code>hello world<\/code>\u3002\u8fd9\u79cd\u529f\u80fd\u5bf9\u4e8e\u9700\u8981\u540c\u65f6\u8f93\u51fa\u591a\u4e2a\u53d8\u91cf\u6216\u5b57\u7b26\u4e32\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h4>3. \u4f7f\u7528\u5206\u9694\u7b26<\/h4>\n<\/p>\n<p><p><code>print()<\/code>\u51fd\u6570\u5141\u8bb8\u6307\u5b9a\u53c2\u6570\u95f4\u7684\u5206\u9694\u7b26\uff0c\u901a\u8fc7<code>sep<\/code>\u53c2\u6570\u53ef\u4ee5\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&#39;hello&#39;, &#39;world&#39;, sep=&#39;-&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\u4e3a<code>hello-world<\/code>\u3002<code>sep<\/code>\u53c2\u6570\u4e3a\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4efb\u4f55\u5206\u9694\u7b26\u3002<\/p>\n<\/p>\n<p><h4>4. \u7ed3\u5c3e\u5b57\u7b26<\/h4>\n<\/p>\n<p><p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code>print()<\/code>\u8f93\u51fa\u540e\u4f1a\u6362\u884c\uff0c\u53ef\u4ee5\u901a\u8fc7<code>end<\/code>\u53c2\u6570\u6539\u53d8\u8fd9\u4e00\u884c\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&#39;hello&#39;, end=&#39; &#39;)<\/p>\n<p>print(&#39;world&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\u4e3a<code>hello world<\/code>\uff0c\u800c\u4e0d\u662f\u5206\u6210\u4e24\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528SYS\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>sys<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e0ePython\u89e3\u91ca\u5668\u76f8\u5173\u7684\u53d8\u91cf\u548c\u51fd\u6570\uff0c<code>sys.stdout<\/code>\u53ef\u4ee5\u7528\u4e8e\u91cd\u5b9a\u5411\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7<code>sys.stdout.write()<\/code>\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c<code>print()<\/code>\u7684\u529f\u80fd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>sys.stdout.write(&#39;hello\\n&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>sys.stdout.write()<\/code>\u4e0d\u4f1a\u81ea\u52a8\u6dfb\u52a0\u6362\u884c\u7b26\uff0c\u9700\u8981\u624b\u52a8\u52a0\u5165\u3002<\/p>\n<\/p>\n<p><h4>2. \u91cd\u5b9a\u5411\u8f93\u51fa<\/h4>\n<\/p>\n<p><p><code>sys.stdout<\/code>\u53ef\u4ee5\u7528\u6765\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u5176\u4ed6\u5730\u65b9\uff0c\u4f8b\u5982\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>original_stdout = sys.stdout<\/p>\n<p>with open(&#39;output.txt&#39;, &#39;w&#39;) as f:<\/p>\n<p>    sys.stdout = f<\/p>\n<p>    print(&#39;hello&#39;)<\/p>\n<p>    sys.stdout = original_stdout<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u5c06<code>hello<\/code>\u5199\u5165\u5230<code>output.txt<\/code>\u6587\u4ef6\u4e2d\uff0c\u800c\u4e0d\u662f\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u901a\u8fc7\u6587\u4ef6\u8f93\u51fa<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u901a\u8fc7<code>sys<\/code>\u6a21\u5757\u91cd\u5b9a\u5411\u8f93\u51fa\uff0c\u8fd8\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u6587\u4ef6\u5bf9\u8c61\u7684<code>write()<\/code>\u65b9\u6cd5\u8fdb\u884c\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u6587\u4ef6\u5bf9\u8c61\u7684<code>write()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u5199\u5165\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&#39;output.txt&#39;, &#39;w&#39;) as f:<\/p>\n<p>    f.write(&#39;hello\\n&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u521b\u5efa\uff08\u6216\u8986\u76d6\uff09\u4e00\u4e2a\u540d\u4e3a<code>output.txt<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u5199\u5165<code>hello<\/code>\u3002<\/p>\n<\/p>\n<p><h4>2. \u9644\u52a0\u6a21\u5f0f<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7<code>open()<\/code>\u51fd\u6570\u7684\u6a21\u5f0f\u53c2\u6570\uff0c\u53ef\u4ee5\u9009\u62e9\u4ee5\u8ffd\u52a0\u6a21\u5f0f\u5199\u5165\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with open(&#39;output.txt&#39;, &#39;a&#39;) as f:<\/p>\n<p>    f.write(&#39; world\\n&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u5728<code>output.txt<\/code>\u6587\u4ef6\u5df2\u6709\u5185\u5bb9\u540e\u8ffd\u52a0<code> world<\/code>\uff0c\u4e0d\u8986\u76d6\u4e4b\u524d\u7684\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5176\u4ed6\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0\u5e38\u7528\u65b9\u6cd5\uff0c\u8fd8\u6709\u4e00\u4e9b\u66f4\u590d\u6742\u6216\u7279\u5b9a\u573a\u666f\u4e0b\u4f7f\u7528\u7684\u8f93\u51fa\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528\u65e5\u5fd7\u6a21\u5757<\/h4>\n<\/p>\n<p><p>Python\u7684<code>logging<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u52a0\u7075\u6d3b\u548c\u5f3a\u5927\u7684\u65e5\u5fd7\u529f\u80fd\uff0c\u53ef\u4ee5\u7528\u4e8e\u8f93\u51fa\u4fe1\u606f\uff1a<\/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(&#39;hello&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u4f1a\u5728\u63a7\u5236\u53f0\u8f93\u51fa<code>INFO:root:hello<\/code>\u3002<code>logging<\/code>\u6a21\u5757\u9002\u7528\u4e8e\u9700\u8981\u8bb0\u5f55\u65e5\u5fd7\u4fe1\u606f\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528GUI\u5e93<\/h4>\n<\/p>\n<p><p>\u5728\u56fe\u5f62\u7528\u6237\u754c\u9762\u5e94\u7528\u4e2d\uff0c\u901a\u5e38\u9700\u8981\u5728\u7a97\u53e3\u5c0f\u90e8\u4ef6\u4e2d\u663e\u793a\u6587\u672c\uff0c\u800c\u4e0d\u662f\u5728\u63a7\u5236\u53f0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tkinter as tk<\/p>\n<p>root = tk.Tk()<\/p>\n<p>label = tk.Label(root, text=&#39;hello&#39;)<\/p>\n<p>label.pack()<\/p>\n<p>root.m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u4f7f\u7528<code>tkinter<\/code>\u5e93\u521b\u5efa\u4e00\u4e2a\u7a97\u53e3\uff0c\u5e76\u5728\u5176\u4e2d\u663e\u793a<code>hello<\/code>\u3002<code>tkinter<\/code>\u662fPython\u6807\u51c6\u5e93\u4e2d\u7684GUI\u5de5\u5177\u5305\uff0c\u9002\u5408\u521b\u5efa\u7b80\u5355\u7684\u684c\u9762\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h4>3. \u4f7f\u7528Web\u6846\u67b6<\/h4>\n<\/p>\n<p><p>\u5728Web\u5e94\u7528\u4e2d\uff0c\u8f93\u51fa\u901a\u5e38\u662f\u6307\u5411\u7528\u6237\u6d4f\u89c8\u5668\u5c55\u793a\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/&#39;)<\/p>\n<p>def hello():<\/p>\n<p>    return &#39;hello&#39;<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    app.run()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u4ee3\u7801\u4f7f\u7528<code>Flask<\/code>\u6846\u67b6\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Web\u670d\u52a1\u5668\uff0c\u5f53\u8bbf\u95ee\u6839\u8def\u5f84\u65f6\uff0c\u6d4f\u89c8\u5668\u5c06\u663e\u793a<code>hello<\/code>\u3002<code>Flask<\/code>\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u6846\u67b6\uff0c\u9002\u5408\u5feb\u901f\u5f00\u53d1Web\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u8f93\u51fa\u201chello\u201d\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c<strong>\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u4f7f\u7528<code>print()<\/code>\u51fd\u6570<\/strong>\uff0c\u5b83\u7b80\u5355\u76f4\u89c2\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u3002\u5bf9\u4e8e\u7279\u6b8a\u9700\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sys<\/code>\u6a21\u5757\u8fdb\u884c\u8f93\u51fa\u91cd\u5b9a\u5411\uff0c\u6216\u8005\u76f4\u63a5\u5199\u5165\u6587\u4ef6\u3002\u6b64\u5916\uff0c\u5728\u9700\u8981\u66f4\u590d\u6742\u529f\u80fd\u7684\u573a\u5408\u4e0b\uff0c<code>logging<\/code>\u6a21\u5757\u3001GUI\u5e93\u4ee5\u53caWeb\u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u76f8\u5e94\u7684\u89e3\u51b3\u65b9\u6848\u3002\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u6253\u5370\u201chello\u201d\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u6765\u8f93\u51fa\u6587\u672c\u3002\u8981\u6253\u5370\u201chello\u201d\uff0c\u53ea\u9700\u5728\u4ee3\u7801\u4e2d\u8f93\u5165<code>print(&quot;hello&quot;)<\/code>\uff0c\u7136\u540e\u8fd0\u884c\u7a0b\u5e8f\uff0c\u63a7\u5236\u53f0\u5c31\u4f1a\u663e\u793a\u201chello\u201d\u3002<\/p>\n<p><strong>Python\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u8f93\u51fa\u201chello\u201d\u5417\uff1f<\/strong><br \/>\u9664\u4e86\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\uff0c\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u5176\u4ed6\u65b9\u5f0f\u8f93\u51fa\u201chello\u201d\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u201chello\u201d\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u6253\u5370\u8be5\u53d8\u91cf\u3002\u793a\u4f8b\u4ee3\u7801\u4e3a\uff1a  <\/p>\n<pre><code class=\"language-python\">greeting = &quot;hello&quot;\nprint(greeting)\n<\/code><\/pre>\n<p><strong>\u5728Python\u4e2d\u53ef\u4ee5\u6253\u5370\u5176\u4ed6\u6587\u672c\u5417\uff1f<\/strong><br \/>\u5f53\u7136\u53ef\u4ee5\u3002\u5728Python\u4e2d\uff0c<code>print()<\/code>\u51fd\u6570\u4e0d\u4ec5\u53ef\u4ee5\u6253\u5370\u5b57\u7b26\u4e32\uff0c\u8fd8\u53ef\u4ee5\u6253\u5370\u6570\u5b57\u3001\u5217\u8868\u3001\u5b57\u5178\u7b49\u591a\u79cd\u6570\u636e\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u6253\u5370\u4e00\u4e2a\u6570\u5b57\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">print(123)\n<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u6253\u5370\u4e00\u4e2a\u5217\u8868\uff1a  <\/p>\n<pre><code class=\"language-python\">print([&quot;hello&quot;, &quot;world&quot;])\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u683c\u5f0f\u5316\u8f93\u51fa\u201chello\u201d\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u6765\u8f93\u51fa\u66f4\u590d\u6742\u7684\u6587\u672c\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u5728\u8f93\u51fa\u4e2d\u5305\u542b\u53d8\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528f-string\uff08\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\uff09\u6216<code>format()<\/code>\u65b9\u6cd5\u3002\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">name = &quot;world&quot;\nprint(f&quot;hello, {name}!&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u4ee3\u7801\u5c06\u8f93\u51fa\u201chello, world!\u201d\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6253\u5370\u201chello\u201d\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f<\/strong><br \/>\u786e\u4fdd\u4f7f\u7528\u6b63\u786e\u7684\u8bed\u6cd5\uff0c\u5b57\u7b26\u4e32\u8981\u7528\u5f15\u53f7\u5305\u88f9\uff08\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u5747\u53ef\uff09\u3002\u6b64\u5916\uff0cPython\u662f\u533a\u5206\u5927\u5c0f\u5199\u7684\uff0c\u56e0\u6b64\u8981\u786e\u4fdd<code>print<\/code>\u7684\u62fc\u5199\u6b63\u786e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u6253\u51fa\u201chello\u201d\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u6838\u5fc3\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528print\u51fd\u6570\u3001\u4f7f\u7528sys\u6a21\u5757\u3001\u901a\u8fc7\u6587\u4ef6 [&hellip;]","protected":false},"author":3,"featured_media":936599,"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\/936592"}],"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=936592"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/936592\/revisions"}],"predecessor-version":[{"id":936600,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/936592\/revisions\/936600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/936599"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=936592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=936592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=936592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}