{"id":1179094,"date":"2025-01-15T18:19:03","date_gmt":"2025-01-15T10:19:03","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1179094.html"},"modified":"2025-01-15T18:19:06","modified_gmt":"2025-01-15T10:19:06","slug":"python%e5%a6%82%e4%bd%95%e6%a3%80%e7%b4%a2%e5%ad%97%e7%ac%a6%e4%b8%b2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1179094.html","title":{"rendered":"python\u5982\u4f55\u68c0\u7d22\u5b57\u7b26\u4e32"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25113624\/d061fbe9-1e86-4177-942b-3a06556d49b0.webp\" alt=\"python\u5982\u4f55\u68c0\u7d22\u5b57\u7b26\u4e32\" \/><\/p>\n<p><p> Python\u68c0\u7d22\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec<strong>\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3001\u5217\u8868\u63a8\u5bfc\u5f0f\u3001\u5b57\u7b26\u4e32\u5207\u7247\u7b49<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u6700\u4e3a\u5e38\u89c1\u548c\u7b80\u5355\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>find()<\/code>\u65b9\u6cd5\u6765\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5982\u679c\u627e\u4e0d\u5230\u5219\u8fd4\u56de-1\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u7684\u4f7f\u7528\u53ca\u5176\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Python \u63d0\u4f9b\u4e86\u591a\u79cd\u5185\u7f6e\u7684\u5b57\u7b26\u4e32\u65b9\u6cd5\u6765\u8fdb\u884c\u5b57\u7b26\u4e32\u68c0\u7d22\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001find() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>find()<\/code> \u65b9\u6cd5\u7528\u4e8e\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u627e\u5230\uff0c\u8fd4\u56de\u5b50\u5b57\u7b26\u4e32\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff1b\u5426\u5219\uff0c\u8fd4\u56de -1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, world!&quot;<\/p>\n<p>index = text.find(&quot;world&quot;)<\/p>\n<p>print(index)  # \u8f93\u51fa: 7<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001index() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>index()<\/code> \u65b9\u6cd5\u4e0e <code>find()<\/code> \u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4f46\u662f\u5982\u679c\u5b50\u5b57\u7b26\u4e32\u4e0d\u5728\u5b57\u7b26\u4e32\u4e2d\uff0c\u4f1a\u5f15\u53d1 <code>ValueError<\/code> \u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    text = &quot;Hello, world!&quot;<\/p>\n<p>    index = text.index(&quot;world&quot;)<\/p>\n<p>    print(index)  # \u8f93\u51fa: 7<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;\u5b50\u5b57\u7b26\u4e32\u672a\u627e\u5230&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001rfind() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>rfind()<\/code> \u65b9\u6cd5\u4e0e <code>find()<\/code> \u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4f46\u5b83\u4ece\u53f3\u4fa7\uff08\u5373\u4ece\u5b57\u7b26\u4e32\u7684\u672b\u5c3e\uff09\u5f00\u59cb\u67e5\u627e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, world!&quot;<\/p>\n<p>index = text.rfind(&quot;o&quot;)<\/p>\n<p>print(index)  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001count() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>count()<\/code> \u65b9\u6cd5\u7528\u4e8e\u8ba1\u7b97\u5b50\u5b57\u7b26\u4e32\u5728\u5b57\u7b26\u4e32\u4e2d\u51fa\u73b0\u7684\u6b21\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, world! Hello, Python!&quot;<\/p>\n<p>count = text.count(&quot;Hello&quot;)<\/p>\n<p>print(count)  # \u8f93\u51fa: 2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<\/h3>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u66f4\u4e3a\u5f3a\u5927\u7684\u5b57\u7b26\u4e32\u68c0\u7d22\u529f\u80fd\u3002Python \u7684 <code>re<\/code> \u6a21\u5757\u53ef\u4ee5\u7528\u4e8e\u5904\u7406\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001search() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>search()<\/code> \u65b9\u6cd5\u7528\u4e8e\u67e5\u627e\u5b57\u7b26\u4e32\u4e2d\u7b2c\u4e00\u6b21\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u4f4d\u7f6e\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5339\u914d\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>text = &quot;Hello, world!&quot;<\/p>\n<p>match = re.search(r&quot;world&quot;, text)<\/p>\n<p>if match:<\/p>\n<p>    print(&quot;\u5339\u914d\u4f4d\u7f6e:&quot;, match.start())  # \u8f93\u51fa: 7<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u672a\u627e\u5230\u5339\u914d&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001findall() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>findall()<\/code> \u65b9\u6cd5\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2d\u6240\u6709\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5b50\u5b57\u7b26\u4e32\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>text = &quot;Hello, world! Hello, Python!&quot;<\/p>\n<p>matches = re.findall(r&quot;Hello&quot;, text)<\/p>\n<p>print(matches)  # \u8f93\u51fa: [&#39;Hello&#39;, &#39;Hello&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001finditer() \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>finditer()<\/code> \u65b9\u6cd5\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u904d\u5386\u5339\u914d\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5339\u914d\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>text = &quot;Hello, world! Hello, Python!&quot;<\/p>\n<p>for match in re.finditer(r&quot;Hello&quot;, text):<\/p>\n<p>    print(&quot;\u5339\u914d\u4f4d\u7f6e:&quot;, match.start())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u7b80\u6d01\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u5305\u542b\u5b57\u7b26\u4e32\u4e2d\u6240\u6709\u5339\u914d\u4f4d\u7f6e\u7684\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, world! Hello, Python!&quot;<\/p>\n<p>sub = &quot;Hello&quot;<\/p>\n<p>indices = [i for i in range(len(text)) if text.startswith(sub, i)]<\/p>\n<p>print(indices)  # \u8f93\u51fa: [0, 14]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u5207\u7247<\/h3>\n<\/p>\n<p><p>\u5b57\u7b26\u4e32\u5207\u7247\u53ef\u4ee5\u7528\u4e8e\u622a\u53d6\u5b57\u7b26\u4e32\u7684\u4e00\u90e8\u5206\uff0c\u4ece\u800c\u5b9e\u73b0\u5b50\u5b57\u7b26\u4e32\u7684\u67e5\u627e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, world!&quot;<\/p>\n<p>sub = &quot;world&quot;<\/p>\n<p>for i in range(len(text) - len(sub) + 1):<\/p>\n<p>    if text[i:i+len(sub)] == sub:<\/p>\n<p>        print(&quot;\u5339\u914d\u4f4d\u7f6e:&quot;, i)  # \u8f93\u51fa: 7<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u6027\u80fd\u5bf9\u6bd4\u53ca\u9002\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u5b57\u7b26\u4e32\u68c0\u7d22\u65b9\u6cd5\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u5bf9\u5404\u79cd\u65b9\u6cd5\u7684\u6027\u80fd\u5bf9\u6bd4\u53ca\u5176\u9002\u7528\u573a\u666f\u7684\u5206\u6790\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u7b80\u5355\u6613\u7528\uff0c\u6027\u80fd\u8f83\u597d\uff0c\u9002\u7528\u4e8e\u7b80\u5355\u7684\u5b57\u7b26\u4e32\u67e5\u627e\u548c\u8ba1\u6570\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u6b63\u5219\u8868\u8fbe\u5f0f<\/h4>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u529f\u80fd\u5f3a\u5927\uff0c\u9002\u7528\u4e8e\u590d\u6742\u7684\u5b57\u7b26\u4e32\u5339\u914d\u548c\u67e5\u627e\uff0c\u4f46\u5176\u6027\u80fd\u53ef\u80fd\u4e0d\u5982\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u5217\u8868\u63a8\u5bfc\u5f0f<\/h4>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u5f0f\u9002\u7528\u4e8e\u9700\u8981\u751f\u6210\u6240\u6709\u5339\u914d\u4f4d\u7f6e\u7684\u60c5\u51b5\uff0c\u4f46\u5176\u6027\u80fd\u53ef\u80fd\u4e0d\u5982\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<\/p>\n<\/p>\n<p><h4>4\u3001\u5b57\u7b26\u4e32\u5207\u7247<\/h4>\n<\/p>\n<p><p>\u5b57\u7b26\u4e32\u5207\u7247\u9002\u7528\u4e8e\u9700\u8981\u9010\u5b57\u7b26\u68c0\u67e5\u7684\u60c5\u51b5\uff0c\u4f46\u5176\u5b9e\u73b0\u8f83\u4e3a\u7e41\u7410\uff0c\u6027\u80fd\u4e5f\u4e0d\u5982\u5176\u4ed6\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u4f18\u5316\u5efa\u8bae<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e3a\u4e86\u63d0\u9ad8\u5b57\u7b26\u4e32\u68c0\u7d22\u7684\u6027\u80fd\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u4f18\u5316\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u9891\u7e41\u8fdb\u884c\u5b57\u7b26\u4e32\u67e5\u627e\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u66f4\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5982\u5b57\u5178\u6216\u96c6\u5408\uff0c\u4ee5\u63d0\u9ad8\u67e5\u627e\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u9884\u5904\u7406\u5b57\u7b26\u4e32<\/h4>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u5b57\u7b26\u4e32\u68c0\u7d22\u4e4b\u524d\uff0c\u53ef\u4ee5\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u9884\u5904\u7406\uff0c\u5982\u8f6c\u4e3a\u5c0f\u5199\u6216\u53bb\u9664\u7a7a\u683c\uff0c\u4ee5\u63d0\u9ad8\u67e5\u627e\u7684\u51c6\u786e\u6027\u548c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b<\/h4>\n<\/p>\n<p><p>\u5bf9\u4e8e\u9700\u8981\u5904\u7406\u5927\u91cf\u5b57\u7b26\u4e32\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\uff0c\u4ee5\u63d0\u9ad8\u5904\u7406\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python \u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u68c0\u7d22\u7684\u65b9\u6cd5\uff0c\u5305\u62ec<strong>\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3001\u5217\u8868\u63a8\u5bfc\u5f0f\u3001\u5b57\u7b26\u4e32\u5207\u7247\u7b49<\/strong>\u3002\u5728\u9009\u62e9\u5177\u4f53\u65b9\u6cd5\u65f6\uff0c\u5e94\u6839\u636e\u5b9e\u9645\u9700\u6c42\u548c\u5b57\u7b26\u4e32\u7684\u590d\u6742\u5ea6\u6765\u9009\u62e9\u6700\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u5e76\u7ed3\u5408\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u4f18\u5316\u5efa\u8bae\uff0c\u4ee5\u63d0\u9ad8\u5b57\u7b26\u4e32\u68c0\u7d22\u7684\u6027\u80fd\u548c\u51c6\u786e\u6027\u3002\u901a\u8fc7\u5bf9\u8fd9\u4e9b\u65b9\u6cd5\u7684\u638c\u63e1\u548c\u4f18\u5316\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u51b3\u5b57\u7b26\u4e32\u68c0\u7d22\u7684\u95ee\u9898\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6574\u4f53\u6027\u80fd\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\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>in<\/code>\u5173\u952e\u5b57\u6765\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u662f\u5426\u5305\u542b\u53e6\u4e00\u4e2a\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>if &quot;\u5b50\u5b57\u7b26\u4e32&quot; in &quot;\u5b8c\u6574\u5b57\u7b26\u4e32&quot;:<\/code>\u8bed\u53e5\u53ef\u4ee5\u8f7b\u677e\u5224\u65ad\u3002\u9664\u6b64\u4e4b\u5916\uff0c<code>str.find()<\/code>\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u7528\u6765\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\uff0c\u8fd4\u56de\u5b50\u5b57\u7b26\u4e32\u7684\u8d77\u59cb\u7d22\u5f15\uff0c\u5982\u679c\u672a\u627e\u5230\u5219\u8fd4\u56de-1\u3002<\/p>\n<p><strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5728Python\u4e2d\u8fdb\u884c\u5b57\u7b26\u4e32\u641c\u7d22\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f<\/strong><br \/>\u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6a21\u5f0f\u5339\u914d\u529f\u80fd\uff0c\u53ef\u4ee5\u7528\u4e8e\u66f4\u590d\u6742\u7684\u5b57\u7b26\u4e32\u68c0\u7d22\u3002Python\u7684<code>re<\/code>\u6a21\u5757\u5141\u8bb8\u7528\u6237\u7f16\u5199\u590d\u6742\u7684\u641c\u7d22\u6a21\u5f0f\uff0c\u4ece\u800c\u80fd\u591f\u5339\u914d\u7279\u5b9a\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3001\u7535\u8bdd\u53f7\u7801\u7b49\u3002\u8fd9\u79cd\u65b9\u6cd5\u5bf9\u4e8e\u9700\u8981\u7075\u6d3b\u5339\u914d\u7684\u573a\u666f\u975e\u5e38\u6709\u6548\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u8fdb\u884c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684\u5b57\u7b26\u4e32\u68c0\u7d22\uff1f<\/strong><br \/>\u8981\u5728\u68c0\u7d22\u65f6\u5ffd\u7565\u5927\u5c0f\u5199\uff0c\u53ef\u4ee5\u5c06\u4e24\u4e2a\u5b57\u7b26\u4e32\u90fd\u8f6c\u6362\u4e3a\u5c0f\u5199\u6216\u5927\u5199\u3002\u4f7f\u7528<code>str.lower()<\/code>\u6216<code>str.upper()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u5b8c\u6574\u5b57\u7b26\u4e32\u548c\u5b50\u5b57\u7b26\u4e32\u90fd\u8f6c\u6362\u4e3a\u5c0f\u5199\uff0c\u7136\u540e\u4f7f\u7528<code>in<\/code>\u5173\u952e\u5b57\u8fdb\u884c\u641c\u7d22\u3002\u8fd9\u79cd\u65b9\u5f0f\u786e\u4fdd\u4e86\u65e0\u8bba\u7528\u6237\u8f93\u5165\u7684\u5927\u5c0f\u5199\u5982\u4f55\uff0c\u90fd\u80fd\u6b63\u786e\u5730\u8fdb\u884c\u68c0\u7d22\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u68c0\u7d22\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3001\u5217\u8868\u63a8\u5bfc\u5f0f\u3001\u5b57\u7b26\u4e32\u5207\u7247\u7b49\u3002\u5176\u4e2d\uff0c\u4f7f [&hellip;]","protected":false},"author":3,"featured_media":1179102,"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\/1179094"}],"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=1179094"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179094\/revisions"}],"predecessor-version":[{"id":1179105,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179094\/revisions\/1179105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1179102"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1179094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1179094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1179094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}