{"id":987548,"date":"2024-12-27T07:54:24","date_gmt":"2024-12-26T23:54:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/987548.html"},"modified":"2024-12-27T07:54:26","modified_gmt":"2024-12-26T23:54:26","slug":"python%e5%a6%82%e4%bd%95%e5%88%a4%e6%96%ad%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/987548.html","title":{"rendered":"python\u5982\u4f55\u5224\u65ad\u8f93\u5165\u6570\u636e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25063615\/1a242c03-dff8-4a50-9174-065f3d4e7f54.webp\" alt=\"python\u5982\u4f55\u5224\u65ad\u8f93\u5165\u6570\u636e\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5224\u65ad\u8f93\u5165\u6570\u636e\u7684\u7c7b\u578b\u3001\u503c\u662f\u5426\u5408\u6cd5\u3001\u683c\u5f0f\u6b63\u786e\u7b49\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u3001\u5f02\u5e38\u5904\u7406\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u7b49\u65b9\u6cd5\u3002\u4f7f\u7528<code>type()<\/code>\u51fd\u6570\u68c0\u67e5\u6570\u636e\u7c7b\u578b\u3001\u4f7f\u7528<code>try-except<\/code>\u5757\u6355\u6349\u5f02\u5e38\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u683c\u5f0f\u662f\u5e38\u7528\u7684\u624b\u6bb5\u3002<\/strong> \u4f8b\u5982\uff0c\u5224\u65ad\u4e00\u4e2a\u8f93\u5165\u662f\u5426\u4e3a\u6574\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528<code>type()<\/code>\u51fd\u6570\u7ed3\u5408\u5f02\u5e38\u5904\u7406\u673a\u5236\u3002\u901a\u8fc7<code>int()<\/code>\u51fd\u6570\u5c1d\u8bd5\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u6574\u6570\uff0c\u5982\u679c\u6210\u529f\u5219\u8bf4\u660e\u8f93\u5165\u662f\u6574\u6570\u7c7b\u578b\uff0c\u5426\u5219\u6355\u83b7\u5230\u7684\u5f02\u5e38\u4f1a\u6307\u51fa\u8f93\u5165\u4e0d\u662f\u6574\u6570\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u63a2\u8ba8\u8fd9\u4e9b\u65b9\u6cd5\u53ca\u5176\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u68c0\u67e5\u6570\u636e\u7c7b\u578b<\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5185\u7f6e\u51fd\u6570\u7528\u4e8e\u68c0\u67e5\u53d8\u91cf\u7684\u7c7b\u578b\uff0c\u6700\u5e38\u7528\u7684\u5305\u62ec<code>type()<\/code>\u548c<code>isinstance()<\/code>\u3002<\/p>\n<\/p>\n<ol>\n<li><code>type()<\/code>\u51fd\u6570<\/li>\n<\/ol>\n<p><p><code>type()<\/code>\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u53d8\u91cf\u7684\u6570\u636e\u7c7b\u578b\u3002\u901a\u8fc7\u6bd4\u8f83\u8fd4\u56de\u7684\u7c7b\u578b\u4e0e\u9884\u671f\u7c7b\u578b\uff0c\u53ef\u4ee5\u5224\u65ad\u8f93\u5165\u6570\u636e\u662f\u5426\u7b26\u5408\u8981\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">input_data = input(&quot;\u8bf7\u8f93\u5165\u6570\u636e: &quot;)<\/p>\n<p>if type(input_data) == str:<\/p>\n<p>    print(&quot;\u8f93\u5165\u662f\u5b57\u7b26\u4e32\u7c7b\u578b&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u5b57\u7b26\u4e32\u7c7b\u578b&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><code>isinstance()<\/code>\u51fd\u6570<\/li>\n<\/ol>\n<p><p><code>isinstance()<\/code>\u51fd\u6570\u66f4\u4e3a\u7075\u6d3b\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u68c0\u67e5\u53d8\u91cf\u662f\u5426\u662f\u67d0\u4e2a\u7c7b\u578b\u7684\u5b9e\u4f8b\u6216\u8005\u662f\u5176\u5b50\u7c7b\u7684\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">input_data = input(&quot;\u8bf7\u8f93\u5165\u6570\u636e: &quot;)<\/p>\n<p>if isinstance(input_data, str):<\/p>\n<p>    print(&quot;\u8f93\u5165\u662f\u5b57\u7b26\u4e32\u7c7b\u578b&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u5b57\u7b26\u4e32\u7c7b\u578b&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u5f02\u5e38\u5904\u7406\u673a\u5236<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5f02\u5e38\u5904\u7406\u673a\u5236\u662f\u9a8c\u8bc1\u8f93\u5165\u6570\u636e\u7684\u91cd\u8981\u5de5\u5177\u3002\u901a\u8fc7<code>try-except<\/code>\u5757\uff0c\u53ef\u4ee5\u4f18\u96c5\u5730\u5904\u7406\u5404\u79cd\u53ef\u80fd\u7684\u9519\u8bef\u548c\u5f02\u5e38\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5224\u65ad\u8f93\u5165\u662f\u5426\u4e3a\u6574\u6570<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u6574\u6570\u5e76\u6355\u83b7\u8f6c\u6362\u5931\u8d25\u7684\u5f02\u5e38\uff0c\u53ef\u4ee5\u5224\u65ad\u8f93\u5165\u662f\u5426\u4e3a\u6709\u6548\u6574\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">input_data = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570: &quot;)<\/p>\n<p>try:<\/p>\n<p>    val = int(input_data)<\/p>\n<p>    print(f&quot;\u8f93\u5165\u662f\u6709\u6548\u7684\u6574\u6570: {val}&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u6574\u6570&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u5224\u65ad\u8f93\u5165\u662f\u5426\u4e3a\u6d6e\u70b9\u6570<\/li>\n<\/ol>\n<p><p>\u7c7b\u4f3c\u5730\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c06\u8f93\u5165\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570\u5e76\u6355\u83b7\u8f6c\u6362\u5931\u8d25\u7684\u5f02\u5e38\u6765\u5224\u65ad\u8f93\u5165\u662f\u5426\u4e3a\u6709\u6548\u6d6e\u70b9\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">input_data = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6d6e\u70b9\u6570: &quot;)<\/p>\n<p>try:<\/p>\n<p>    val = float(input_data)<\/p>\n<p>    print(f&quot;\u8f93\u5165\u662f\u6709\u6548\u7684\u6d6e\u70b9\u6570: {val}&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u6d6e\u70b9\u6570&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u683c\u5f0f<\/p>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u9a8c\u8bc1\u8f93\u5165\u683c\u5f0f\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<ol>\n<li>\u9a8c\u8bc1\u90ae\u7bb1\u5730\u5740\u683c\u5f0f<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u68c0\u67e5\u7528\u6237\u8f93\u5165\u7684\u90ae\u7bb1\u5730\u5740\u683c\u5f0f\u662f\u5426\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>input_data = input(&quot;\u8bf7\u8f93\u5165\u90ae\u7bb1\u5730\u5740: &quot;)<\/p>\n<p>em<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>l_regex = r&#39;^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$&#39;<\/p>\n<p>if re.match(email_regex, input_data):<\/p>\n<p>    print(&quot;\u8f93\u5165\u662f\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u9a8c\u8bc1\u7535\u8bdd\u53f7\u7801\u683c\u5f0f<\/li>\n<\/ol>\n<p><p>\u540c\u6837\u5730\uff0c\u53ef\u4ee5\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u7535\u8bdd\u53f7\u7801\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>input_data = input(&quot;\u8bf7\u8f93\u5165\u7535\u8bdd\u53f7\u7801: &quot;)<\/p>\n<p>phone_regex = r&#39;^\\+?\\d{1,3}?[-.\\s]?\\(?(?:\\d{1,4})\\)?[-.\\s]?\\d\\d\\d[-.\\s]?\\d\\d\\d\\d$&#39;<\/p>\n<p>if re.match(phone_regex, input_data):<\/p>\n<p>    print(&quot;\u8f93\u5165\u662f\u6709\u6548\u7684\u7535\u8bdd\u53f7\u7801&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u7535\u8bdd\u53f7\u7801&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u8fdb\u884c\u7efc\u5408\u5224\u65ad<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u901a\u5e38\u9700\u8981\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u8fdb\u884c\u7efc\u5408\u5224\u65ad\uff0c\u4ee5\u786e\u4fdd\u8f93\u5165\u6570\u636e\u7684\u51c6\u786e\u6027\u548c\u5b89\u5168\u6027\u3002<\/p>\n<\/p>\n<ol>\n<li>\u68c0\u67e5\u6570\u636e\u7c7b\u578b\u548c\u6570\u503c\u8303\u56f4<\/li>\n<\/ol>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4ec5\u4ec5\u9a8c\u8bc1\u6570\u636e\u7c7b\u578b\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u8fdb\u4e00\u6b65\u68c0\u67e5\u6570\u503c\u8303\u56f4\u3002\u4f8b\u5982\uff0c\u5728\u9700\u8981\u6574\u6570\u5728\u67d0\u4e2a\u8303\u56f4\u5185\u65f6\uff0c\u9664\u4e86\u9a8c\u8bc1\u6570\u636e\u662f\u5426\u4e3a\u6574\u6570\uff0c\u8fd8\u9700\u68c0\u67e5\u5176\u503c\u662f\u5426\u5728\u9884\u671f\u8303\u56f4\u5185\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">input_data = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a1\u5230100\u4e4b\u95f4\u7684\u6574\u6570: &quot;)<\/p>\n<p>try:<\/p>\n<p>    val = int(input_data)<\/p>\n<p>    if 1 &lt;= val &lt;= 100:<\/p>\n<p>        print(f&quot;\u8f93\u5165\u7684\u6574\u6570\u5728\u8303\u56f4\u5185: {val}&quot;)<\/p>\n<p>    else:<\/p>\n<p>        print(&quot;\u8f93\u5165\u7684\u6574\u6570\u4e0d\u57281\u5230100\u8303\u56f4\u5185&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u6574\u6570&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u9a8c\u8bc1\u683c\u5f0f\u548c\u903b\u8f91<\/li>\n<\/ol>\n<p><p>\u5728\u5904\u7406\u65e5\u671f\u3001\u65f6\u95f4\u7b49\u590d\u6742\u683c\u5f0f\u65f6\uff0c\u9664\u4e86\u683c\u5f0f\u9a8c\u8bc1\u5916\uff0c\u8fd8\u9700\u786e\u4fdd\u903b\u8f91\u7684\u6b63\u786e\u6027\u3002\u4f8b\u5982\uff0c\u65e5\u671f\u7684\u6708\u4efd\u4e0d\u5e94\u8d85\u8fc712\uff0c\u6708\u4efd\u7684\u5929\u6570\u5e94\u5728\u5408\u7406\u8303\u56f4\u5185\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import datetime<\/p>\n<p>input_data = input(&quot;\u8bf7\u8f93\u5165\u65e5\u671f\uff08\u683c\u5f0f\uff1aYYYY-MM-DD\uff09: &quot;)<\/p>\n<p>try:<\/p>\n<p>    datetime.datetime.strptime(input_data, &#39;%Y-%m-%d&#39;)<\/p>\n<p>    print(&quot;\u8f93\u5165\u662f\u6709\u6548\u7684\u65e5\u671f&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u8f93\u5165\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u65e5\u671f&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u7528\u6237\u8f93\u5165\u7684\u5b89\u5168\u6027\u8003\u8651<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u7528\u6237\u8f93\u5165\u65f6\uff0c\u5b89\u5168\u6027\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u8003\u8651\u56e0\u7d20\uff0c\u5c24\u5176\u662f\u5728Web\u5e94\u7528\u4e2d\uff0c\u5fc5\u987b\u9632\u6b62SQL\u6ce8\u5165\u3001XSS\u7b49\u653b\u51fb\u3002<\/p>\n<\/p>\n<ol>\n<li>\u9632\u6b62SQL\u6ce8\u5165<\/li>\n<\/ol>\n<p><p>\u5728\u5904\u7406\u6570\u636e\u5e93\u76f8\u5173\u7684\u8f93\u5165\u65f6\uff0c\u5e94\u4f7f\u7528\u53c2\u6570\u5316\u67e5\u8be2\u6216ORM\u6846\u67b6\u6765\u907f\u514dSQL\u6ce8\u5165\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<p>conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<p>cursor = conn.cursor()<\/p>\n<p>user_input = input(&quot;\u8bf7\u8f93\u5165\u7528\u6237\u540d: &quot;)<\/p>\n<p>query = &quot;SELECT * FROM users WHERE username = ?&quot;<\/p>\n<p>cursor.execute(query, (user_input,))<\/p>\n<p>results = cursor.fetchall()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u9632\u6b62XSS\u653b\u51fb<\/li>\n<\/ol>\n<p><p>\u5728Web\u5e94\u7528\u4e2d\uff0c\u8f93\u51fa\u7528\u6237\u8f93\u5165\u65f6\u9700\u8981\u5bf9\u7279\u6b8a\u5b57\u7b26\u8fdb\u884c\u8f6c\u4e49\uff0c\u4ee5\u9632\u6b62XSS\u653b\u51fb\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from html import escape<\/p>\n<p>user_input = input(&quot;\u8bf7\u8f93\u5165\u8bc4\u8bba: &quot;)<\/p>\n<p><a href=\"https:\/\/docs.pingcode.com\/agile\/agile-at-scale\/what-is-safe\" target=\"_blank\">SAFe<\/a>_input = escape(user_input)<\/p>\n<p>print(f&quot;\u5b89\u5168\u8f93\u51fa: {safe_input}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5224\u65ad\u548c\u5904\u7406\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\uff0c\u786e\u4fdd\u6570\u636e\u7684\u7c7b\u578b\u3001\u683c\u5f0f\u548c\u5b89\u5168\u6027\u6ee1\u8db3\u5e94\u7528\u7684\u8981\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u9a8c\u8bc1\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u7c7b\u578b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>type()<\/code>\u51fd\u6570\u6765\u68c0\u67e5\u8f93\u5165\u6570\u636e\u7684\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u83b7\u53d6\u7528\u6237\u8f93\u5165\u540e\uff0c\u53ef\u4ee5\u5c06\u5176\u8f6c\u6362\u4e3a\u7279\u5b9a\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5982\u6574\u6570\u6216\u6d6e\u70b9\u6570\u3002\u901a\u8fc7\u5bf9\u6bd4\u7c7b\u578b\uff0c\u53ef\u4ee5\u9a8c\u8bc1\u8f93\u5165\u6570\u636e\u662f\u5426\u7b26\u5408\u9884\u671f\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u7528\u6237\u8f93\u5165\u9519\u8bef\u5e76\u63d0\u4f9b\u53cd\u9988\uff1f<\/strong><br \/>\u4e3a\u4e86\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try-except<\/code>\u7ed3\u6784\u6765\u6355\u83b7\u8f93\u5165\u9519\u8bef\u3002\u5f53\u7528\u6237\u8f93\u5165\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u6570\u636e\u7c7b\u578b\u65f6\uff0c\u53ef\u4ee5\u6355\u83b7\u5f02\u5e38\u5e76\u8f93\u51fa\u53cb\u597d\u7684\u63d0\u793a\u4fe1\u606f\uff0c\u6307\u5bfc\u7528\u6237\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u6570\u636e\u3002\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u51cf\u5c11\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u9519\u8bef\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u521b\u5efa\u81ea\u5b9a\u4e49\u7684\u8f93\u5165\u9a8c\u8bc1\u51fd\u6570\uff1f<\/strong><br \/>\u7edd\u5bf9\u53ef\u4ee5\uff01\u901a\u8fc7\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\uff0c\u60a8\u53ef\u4ee5\u5c01\u88c5\u8f93\u5165\u9a8c\u8bc1\u7684\u903b\u8f91\uff0c\u68c0\u67e5\u8f93\u5165\u662f\u5426\u7b26\u5408\u7279\u5b9a\u6807\u51c6\uff0c\u6bd4\u5982\u8303\u56f4\u68c0\u67e5\u3001\u683c\u5f0f\u68c0\u67e5\u7b49\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u60a8\u4e0d\u4ec5\u80fd\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\uff0c\u8fd8\u80fd\u5728\u591a\u4e2a\u5730\u65b9\u91cd\u7528\u8fd9\u6bb5\u903b\u8f91\uff0c\u589e\u5f3a\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5224\u65ad\u8f93\u5165\u6570\u636e\u7684\u7c7b\u578b\u3001\u503c\u662f\u5426\u5408\u6cd5\u3001\u683c\u5f0f\u6b63\u786e\u7b49\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u3001\u5f02\u5e38\u5904\u7406\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u7b49\u65b9\u6cd5\u3002\u4f7f\u7528 [&hellip;]","protected":false},"author":3,"featured_media":987558,"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\/987548"}],"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=987548"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987548\/revisions"}],"predecessor-version":[{"id":987561,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987548\/revisions\/987561"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/987558"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=987548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=987548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=987548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}