{"id":1087926,"date":"2025-01-08T13:39:37","date_gmt":"2025-01-08T05:39:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1087926.html"},"modified":"2025-01-08T13:39:39","modified_gmt":"2025-01-08T05:39:39","slug":"python%e8%be%93%e5%85%a5%e5%a6%82%e4%bd%95%e8%bd%ac%e6%8d%a2%e7%b1%bb%e5%9e%8b%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1087926.html","title":{"rendered":"python\u8f93\u5165\u5982\u4f55\u8f6c\u6362\u7c7b\u578b\u6570\u636e\u7c7b\u578b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24200623\/c1f8c62a-c9e3-4c2f-935b-a01acd5ebf17.webp\" alt=\"python\u8f93\u5165\u5982\u4f55\u8f6c\u6362\u7c7b\u578b\u6570\u636e\u7c7b\u578b\" \/><\/p>\n<p><p> <strong>\u5728 Python \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff1a\u4f7f\u7528\u5185\u7f6e\u8f6c\u6362\u51fd\u6570\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u51fd\u6570\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u7b49\u3002<\/strong> \u5176\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 Python \u63d0\u4f9b\u7684\u5185\u7f6e\u51fd\u6570\u5982 <code>int()<\/code>, <code>float()<\/code>, <code>str()<\/code>, <code>list()<\/code>, <code>tuple()<\/code>, <code>dict()<\/code> \u7b49\u3002\u8fd9\u4e9b\u51fd\u6570\u53ef\u4ee5\u5c06\u8f93\u5165\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u76f8\u5e94\u7684\u7c7b\u578b\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u5185\u7f6e\u8f6c\u6362\u51fd\u6570\uff1a<\/strong> Python \u63d0\u4f9b\u4e86\u4e00\u4e9b\u5185\u7f6e\u51fd\u6570\u6765\u8f6c\u6362\u6570\u636e\u7c7b\u578b\u3002\u6bd4\u5982\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u53ef\u4ee5\u4f7f\u7528 <code>int()<\/code> \u51fd\u6570\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570\u53ef\u4ee5\u4f7f\u7528 <code>float()<\/code> \u51fd\u6570\u3002\u8fd9\u4e9b\u51fd\u6570\u5728\u5904\u7406\u8f93\u5165\u6570\u636e\u65f6\u975e\u5e38\u65b9\u4fbf\u548c\u9ad8\u6548\u3002<\/p>\n<\/p>\n<hr>\n<h2><strong>\u4e00\u3001\u5185\u7f6e\u8f6c\u6362\u51fd\u6570<\/strong><\/h2>\n<p><h2>1\u3001\u5b57\u7b26\u4e32\u8f6c\u6574\u6570<\/h2>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>int()<\/code> \u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u4f8b\u5982\uff0c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u901a\u5e38\u662f\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u5982\u679c\u8981\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\uff0c\u5c31\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3a\u6574\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570: &quot;)<\/p>\n<p>integer_value = int(user_input)<\/p>\n<p>print(f&quot;\u8f6c\u6362\u540e\u7684\u6574\u6570\u503c\u4e3a: {integer_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>input()<\/code> \u51fd\u6570\u4ece\u7528\u6237\u83b7\u53d6\u8f93\u5165\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\u3002<code>int()<\/code> \u51fd\u6570\u5c06\u8fd9\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u5982\u679c\u8f93\u5165\u7684\u5185\u5bb9\u4e0d\u80fd\u88ab\u8f6c\u6362\u4e3a\u6574\u6570\uff08\u5982\u8f93\u5165\u7684\u662f\u5b57\u6bcd\uff09\uff0c\u5219\u4f1a\u5f15\u53d1 <code>ValueError<\/code> \u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><h2>2\u3001\u5b57\u7b26\u4e32\u8f6c\u6d6e\u70b9\u6570<\/h2>\n<\/p>\n<p><p>\u7c7b\u4f3c\u5730\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>float()<\/code> \u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6d6e\u70b9\u6570: &quot;)<\/p>\n<p>float_value = float(user_input)<\/p>\n<p>print(f&quot;\u8f6c\u6362\u540e\u7684\u6d6e\u70b9\u503c\u4e3a: {float_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>float()<\/code> \u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570\uff0c\u5982\u679c\u8f93\u5165\u7684\u5185\u5bb9\u4e0d\u80fd\u88ab\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570\uff08\u5982\u8f93\u5165\u7684\u662f\u5b57\u6bcd\uff09\uff0c\u5219\u4f1a\u5f15\u53d1 <code>ValueError<\/code> \u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><h2>3\u3001\u5b57\u7b26\u4e32\u8f6c\u5217\u8868<\/h2>\n<\/p>\n<p><p>\u5982\u679c\u7528\u6237\u8f93\u5165\u7684\u662f\u591a\u4e2a\u503c\uff0c\u5e76\u5e0c\u671b\u5c06\u5176\u8f6c\u6362\u4e3a\u5217\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>split()<\/code> \u65b9\u6cd5\u548c <code>list()<\/code> \u51fd\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u503c\uff08\u7528\u7a7a\u683c\u5206\u9694\uff09: &quot;)<\/p>\n<p>list_value = user_input.split()<\/p>\n<p>print(f&quot;\u8f6c\u6362\u540e\u7684\u5217\u8868\u503c\u4e3a: {list_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>split()<\/code> \u65b9\u6cd5\u5c06\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u6309\u7167\u7a7a\u683c\u5206\u9694\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u5404\u4e2a\u5b50\u5b57\u7b26\u4e32\u7684\u5217\u8868\u3002<\/p>\n<\/p>\n<h2><strong>\u4e8c\u3001\u81ea\u5b9a\u4e49\u8f6c\u6362\u51fd\u6570<\/strong><\/h2>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5185\u7f6e\u51fd\u6570\u53ef\u80fd\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u8fd9\u65f6\u53ef\u4ee5\u5b9a\u4e49\u81ea\u5df1\u7684\u8f6c\u6362\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u5c06\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5e03\u5c14\u503c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def str_to_bool(s):<\/p>\n<p>    if s.lower() in [&#39;true&#39;, &#39;yes&#39;, &#39;1&#39;]:<\/p>\n<p>        return True<\/p>\n<p>    elif s.lower() in [&#39;false&#39;, &#39;no&#39;, &#39;0&#39;]:<\/p>\n<p>        return False<\/p>\n<p>    else:<\/p>\n<p>        r<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>se ValueError(&quot;\u65e0\u6cd5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u5e03\u5c14\u503c&quot;)<\/p>\n<p>user_input = input(&quot;\u8bf7\u8f93\u5165\u5e03\u5c14\u503c\uff08true\/false\uff09: &quot;)<\/p>\n<p>bool_value = str_to_bool(user_input)<\/p>\n<p>print(f&quot;\u8f6c\u6362\u540e\u7684\u5e03\u5c14\u503c\u4e3a: {bool_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u81ea\u5b9a\u4e49\u51fd\u6570 <code>str_to_bool<\/code> \u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5e03\u5c14\u503c\u3002\u5982\u679c\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u4e0d\u662f\u9884\u671f\u7684\u503c\uff0c\u5219\u629b\u51fa <code>ValueError<\/code> \u5f02\u5e38\u3002<\/p>\n<\/p>\n<h2><strong>\u4e09\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/strong><\/h2>\n<p><p>\u6709\u65f6\u4e3a\u4e86\u66f4\u590d\u6742\u7684\u8f6c\u6362\u9700\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 <code>pandas<\/code> \u5e93\u5c06\u8f93\u5165\u7684 CSV \u683c\u5f0f\u6570\u636e\u8f6c\u6362\u4e3a\u6570\u636e\u6846\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>from io import StringIO<\/p>\n<p>user_input = input(&quot;\u8bf7\u8f93\u5165CSV\u683c\u5f0f\u7684\u6570\u636e: &quot;)<\/p>\n<p>data = StringIO(user_input)<\/p>\n<p>df = pd.read_csv(data)<\/p>\n<p>print(f&quot;\u8f6c\u6362\u540e\u7684\u6570\u636e\u6846\u4e3a:\\n{df}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c<code>pandas<\/code> \u5e93\u7684 <code>read_csv<\/code> \u51fd\u6570\u53ef\u4ee5\u5c06 CSV \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u636e\u6846\u3002<\/p>\n<\/p>\n<h2><strong>\u56db\u3001\u5f02\u5e38\u5904\u7406<\/strong><\/h2>\n<p><p>\u5728\u6570\u636e\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u65e0\u6cd5\u8f6c\u6362\u7684\u6570\u636e\uff0c\u56e0\u6b64\u6dfb\u52a0\u5f02\u5e38\u5904\u7406\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u53ef\u4ee5\u4f7f\u7528 <code>try-except<\/code> \u8bed\u53e5\u6765\u6355\u83b7\u5e76\u5904\u7406\u8fd9\u4e9b\u5f02\u5e38\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570: &quot;)<\/p>\n<p>try:<\/p>\n<p>    integer_value = int(user_input)<\/p>\n<p>    print(f&quot;\u8f6c\u6362\u540e\u7684\u6574\u6570\u503c\u4e3a: {integer_value}&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u8f93\u5165\u7684\u5185\u5bb9\u65e0\u6cd5\u8f6c\u6362\u4e3a\u6574\u6570\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7 <code>try-except<\/code> \u8bed\u53e5\uff0c\u53ef\u4ee5\u6355\u83b7 <code>ValueError<\/code> \u5f02\u5e38\uff0c\u5e76\u5728\u53d1\u751f\u5f02\u5e38\u65f6\u7ed9\u7528\u6237\u53cb\u597d\u7684\u63d0\u793a\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u5d29\u6e83\u3002<\/p>\n<\/p>\n<h2><strong>\u4e94\u3001\u7efc\u5408\u5e94\u7528\u793a\u4f8b<\/strong><\/h2>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7efc\u5408\u5e94\u7528\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5c06\u7528\u6237\u8f93\u5165\u7684\u5404\u79cd\u7c7b\u578b\u6570\u636e\u8fdb\u884c\u8f6c\u6362\uff0c\u5e76\u5904\u7406\u5f02\u5e38\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def convert_input(user_input, data_type):<\/p>\n<p>    try:<\/p>\n<p>        if data_type == &#39;int&#39;:<\/p>\n<p>            return int(user_input)<\/p>\n<p>        elif data_type == &#39;float&#39;:<\/p>\n<p>            return float(user_input)<\/p>\n<p>        elif data_type == &#39;list&#39;:<\/p>\n<p>            return user_input.split()<\/p>\n<p>        elif data_type == &#39;bool&#39;:<\/p>\n<p>            return str_to_bool(user_input)<\/p>\n<p>        else:<\/p>\n<p>            return str(user_input)<\/p>\n<p>    except ValueError:<\/p>\n<p>        print(f&quot;\u8f93\u5165\u7684\u5185\u5bb9\u65e0\u6cd5\u8f6c\u6362\u4e3a {data_type} \u7c7b\u578b\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002&quot;)<\/p>\n<p>        return None<\/p>\n<p>def str_to_bool(s):<\/p>\n<p>    if s.lower() in [&#39;true&#39;, &#39;yes&#39;, &#39;1&#39;]:<\/p>\n<p>        return True<\/p>\n<p>    elif s.lower() in [&#39;false&#39;, &#39;no&#39;, &#39;0&#39;]:<\/p>\n<p>        return False<\/p>\n<p>    else:<\/p>\n<p>        raise ValueError(&quot;\u65e0\u6cd5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u5e03\u5c14\u503c&quot;)<\/p>\n<p>user_input = input(&quot;\u8bf7\u8f93\u5165\u503c: &quot;)<\/p>\n<p>data_type = input(&quot;\u8bf7\u8f93\u5165\u76ee\u6807\u6570\u636e\u7c7b\u578b\uff08int\/float\/list\/bool\/str\uff09: &quot;)<\/p>\n<p>converted_value = convert_input(user_input, data_type)<\/p>\n<p>if converted_value is not None:<\/p>\n<p>    print(f&quot;\u8f6c\u6362\u540e\u7684\u503c\u4e3a: {converted_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2a\u901a\u7528\u7684 <code>convert_input<\/code> \u51fd\u6570\uff0c\u6839\u636e\u7528\u6237\u6307\u5b9a\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u76f8\u5e94\u7684\u7c7b\u578b\uff0c\u5e76\u5904\u7406\u53ef\u80fd\u7684\u8f6c\u6362\u5f02\u5e38\u3002\u540c\u65f6\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2a <code>str_to_bool<\/code> \u51fd\u6570\uff0c\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5e03\u5c14\u503c\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u5c06\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u4e0d\u540c\u7684\u7c7b\u578b\uff0c\u5e76\u5904\u7406\u53ef\u80fd\u7684\u5f02\u5e38\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u5b57\u7b26\u4e32<code>&quot;123&quot;<\/code>\uff0c\u53ef\u4ee5\u901a\u8fc7<code>int(&quot;123&quot;)<\/code>\u5c06\u5176\u8f6c\u6362\u4e3a\u6574\u6570<code>123<\/code>\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5b57\u7b26\u4e32\u5fc5\u987b\u80fd\u591f\u6b63\u786e\u5730\u8868\u793a\u4e00\u4e2a\u6574\u6570\uff0c\u5426\u5219\u4f1a\u629b\u51fa<code>ValueError<\/code>\u5f02\u5e38\u3002<\/p>\n<p><strong>\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570\uff0c\u4f46\u8fd9\u4f1a\u76f4\u63a5\u622a\u65ad\u5c0f\u6570\u90e8\u5206\u3002\u4f8b\u5982\uff0c<code>int(3.14)<\/code>\u5c06\u8fd4\u56de<code>3<\/code>\u3002\u5982\u679c\u9700\u8981\u66f4\u7cbe\u786e\u5730\u8fdb\u884c\u56db\u820d\u4e94\u5165\uff0c\u53ef\u4ee5\u4f7f\u7528<code>round()<\/code>\u51fd\u6570\uff0c\u50cf\u8fd9\u6837\uff1a<code>round(3.14)<\/code>\u5c06\u8fd4\u56de<code>3<\/code>\uff0c\u800c<code>round(3.6)<\/code>\u5c06\u8fd4\u56de<code>4<\/code>\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5c06\u5217\u8868\u4e2d\u7684\u6240\u6709\u5143\u7d20\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u6216<code>map()<\/code>\u51fd\u6570\u6765\u5c06\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u5217\u8868<code>my_list = [1, 2, 3]<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528<code>[str(x) for x in my_list]<\/code>\u6216<code>list(map(str, my_list))<\/code>\u6765\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u5217\u8868<code>[&#39;1&#39;, &#39;2&#39;, &#39;3&#39;]<\/code>\u3002\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u5730\u5c06\u6240\u6709\u5143\u7d20\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u7c7b\u578b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728 Python \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff1a\u4f7f\u7528\u5185\u7f6e\u8f6c\u6362\u51fd\u6570\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u51fd\u6570\u3001\u4f7f\u7528\u7b2c [&hellip;]","protected":false},"author":3,"featured_media":1087934,"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\/1087926"}],"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=1087926"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1087926\/revisions"}],"predecessor-version":[{"id":1087935,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1087926\/revisions\/1087935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1087934"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1087926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1087926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1087926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}