{"id":1131626,"date":"2025-01-08T20:50:08","date_gmt":"2025-01-08T12:50:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1131626.html"},"modified":"2025-01-08T20:50:11","modified_gmt":"2025-01-08T12:50:11","slug":"python%e4%b8%ad%e5%9c%86%e5%91%a8%e7%8e%87%e5%a6%82%e4%bd%95%e6%89%93%e5%8d%b0%e5%87%ba%e6%9d%a5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1131626.html","title":{"rendered":"Python\u4e2d\u5706\u5468\u7387\u5982\u4f55\u6253\u5370\u51fa\u6765"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101346\/63aa519f-b7a5-44fb-ba90-9eb3030c827d.webp\" alt=\"Python\u4e2d\u5706\u5468\u7387\u5982\u4f55\u6253\u5370\u51fa\u6765\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u8ba1\u7b97\u548c\u6253\u5370\u5706\u5468\u7387\uff08\u03c0\uff09\u3002<\/strong> \u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u6807\u51c6\u5e93\u4e2d\u7684\u6570\u5b66\u6a21\u5757\u3001\u7b2c\u4e09\u65b9\u5e93\u3001\u4ee5\u53ca\u81ea\u5b9a\u4e49\u7b97\u6cd5\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u51e0\u79cd\u65b9\u6cd5\uff0c\u5e76\u89e3\u6790\u5176\u4e2d\u7684\u5173\u952e\u70b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u6570\u5b66\u6a21\u5757\uff08math module\uff09<\/h3>\n<\/p>\n<p><p>Python\u7684\u6807\u51c6\u5e93\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u4e3a<code>math<\/code>\u7684\u6a21\u5757\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u8bb8\u591a\u5b9e\u7528\u7684\u6570\u5b66\u51fd\u6570\u548c\u5e38\u91cf\uff0c\u5305\u62ec\u5706\u5468\u7387\u3002\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e2a\u6a21\u5757\u662f\u6700\u7b80\u5355\u548c\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<p><h4>1. \u5bfc\u5165math\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165<code>math<\/code>\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6253\u5370\u5706\u5468\u7387<\/h4>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<code>math.pi<\/code>\u6765\u83b7\u53d6\u5706\u5468\u7387\uff0c\u5e76\u6253\u5370\u51fa\u6765\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(math.pi)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5706\u5468\u7387\u7684\u4e00\u4e2a\u8fd1\u4f3c\u503c\uff0c\u901a\u5e38\u7cbe\u786e\u5230\u5c0f\u6570\u70b9\u540e15\u4f4d\u5de6\u53f3\u3002<\/p>\n<\/p>\n<p><h4>3. \u8be6\u7ec6\u89e3\u91ca<\/h4>\n<\/p>\n<p><p><strong>math\u6a21\u5757<\/strong>\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u9700\u8981\u5b89\u88c5\u4efb\u4f55\u989d\u5916\u7684\u5305\u3002\u901a\u8fc7<code>math.pi<\/code>\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u83b7\u53d6\u4e00\u4e2a\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c\uff0c\u8fd9\u5728\u5927\u591a\u6570\u5e94\u7528\u573a\u666f\u4e0b\u5df2\u7ecf\u8db3\u591f\u4e86\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528NumPy\u5e93<\/h3>\n<\/p>\n<p><p>NumPy\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u9886\u57df\u3002\u5b83\u540c\u6837\u63d0\u4f9b\u4e86\u5bf9\u5706\u5468\u7387\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5NumPy<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5NumPy\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5bfc\u5165NumPy\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u7136\u540e\u5bfc\u5165NumPy\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u6253\u5370\u5706\u5468\u7387<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>np.pi<\/code>\u6765\u83b7\u53d6\u5706\u5468\u7387\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(np.pi)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u8be6\u7ec6\u89e3\u91ca<\/h4>\n<\/p>\n<p><p><strong>NumPy<\/strong> \u63d0\u4f9b\u4e86\u66f4\u5e7f\u6cdb\u7684\u79d1\u5b66\u8ba1\u7b97\u529f\u80fd\uff0c\u5982\u679c\u4f60\u7684\u9879\u76ee\u5df2\u7ecf\u5728\u4f7f\u7528NumPy\uff0c\u90a3\u4e48\u5b83\u662f\u4e00\u4e2a\u81ea\u7136\u7684\u9009\u62e9\u3002NumPy\u7684\u5706\u5468\u7387\u540c\u6837\u7cbe\u786e\u5230\u5c0f\u6570\u70b9\u540e15\u4f4d\u5de6\u53f3\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528SymPy\u5e93<\/h3>\n<\/p>\n<p><p>SymPy\u662f\u4e00\u4e2a\u7528\u4e8e\u7b26\u53f7\u8ba1\u7b97\u7684Python\u5e93\uff0c\u5b83\u80fd\u591f\u63d0\u4f9b\u66f4\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5SymPy<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u5b89\u88c5SymPy\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install sympy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5bfc\u5165SymPy\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u5bfc\u5165SymPy\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sympy as sp<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u6253\u5370\u5706\u5468\u7387<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528<code>sp.pi<\/code>\u6765\u83b7\u53d6\u5706\u5468\u7387\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(sp.pi.evalf())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u8be6\u7ec6\u89e3\u91ca<\/h4>\n<\/p>\n<p><p><strong>SymPy<\/strong> \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7b26\u53f7\u8ba1\u7b97\u5e93\uff0c\u80fd\u591f\u8fdb\u884c\u9ad8\u7cbe\u5ea6\u7684\u6570\u5b66\u8ba1\u7b97\u3002\u901a\u8fc7<code>sp.pi.evalf()<\/code>\uff0c\u4f60\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u975e\u5e38\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c\uff0c\u8fd9\u5728\u67d0\u4e9b\u9700\u8981\u9ad8\u7cbe\u5ea6\u8ba1\u7b97\u7684\u573a\u666f\u4e0b\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u7b97\u6cd5<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5bf9\u8ba1\u7b97\u673a\u79d1\u5b66\u548c\u6570\u5b66\u6709\u4e00\u5b9a\u7684\u4e86\u89e3\uff0c\u4f60\u53ef\u80fd\u4f1a\u5bf9\u5982\u4f55\u901a\u8fc7\u7b97\u6cd5\u6765\u8ba1\u7b97\u5706\u5468\u7387\u611f\u5174\u8da3\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u7b97\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1. \u5229\u7528\u83b1\u5e03\u5c3c\u8328\u7ea7\u6570<\/h4>\n<\/p>\n<p><p>\u83b1\u5e03\u5c3c\u8328\u7ea7\u6570\u662f\u4e00\u4e2a\u7b80\u5355\u4f46\u6536\u655b\u8f83\u6162\u7684\u7b97\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def leibniz_pi(n_terms):<\/p>\n<p>    pi_estimate = 0<\/p>\n<p>    for i in range(n_terms):<\/p>\n<p>        pi_estimate += ((-1)i) \/ (2*i + 1)<\/p>\n<p>    return pi_estimate * 4<\/p>\n<p>print(leibniz_pi(1000000))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5229\u7528\u8499\u7279\u5361\u7f57\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u8499\u7279\u5361\u7f57\u65b9\u6cd5\u662f\u4e00\u79cd\u57fa\u4e8e\u968f\u673a\u6570\u7684\u7b97\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import random<\/p>\n<p>def monte_carlo_pi(n_samples):<\/p>\n<p>    inside_circle = 0<\/p>\n<p>    for _ in range(n_samples):<\/p>\n<p>        x, y = random.random(), random.random()<\/p>\n<p>        if x&lt;strong&gt;2 + y&lt;\/strong&gt;2 &lt;= 1:<\/p>\n<p>            inside_circle += 1<\/p>\n<p>    return (inside_circle \/ n_samples) * 4<\/p>\n<p>print(monte_carlo_pi(1000000))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u8be6\u7ec6\u89e3\u91ca<\/h4>\n<\/p>\n<p><p><strong>\u81ea\u5b9a\u4e49\u7b97\u6cd5<\/strong> \u63d0\u4f9b\u4e86\u6df1\u5165\u7406\u89e3\u5706\u5468\u7387\u8ba1\u7b97\u7684\u673a\u4f1a\u3002\u901a\u8fc7\u5b9e\u73b0\u8fd9\u4e9b\u7b97\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5b66\u4e60\u5230\u8bb8\u591a\u6570\u5b66\u548c\u8ba1\u7b97\u673a\u79d1\u5b66\u7684\u77e5\u8bc6\u3002\u83b1\u5e03\u5c3c\u8328\u7ea7\u6570\u7b80\u5355\u6613\u61c2\uff0c\u4f46\u6536\u655b\u8f83\u6162\uff1b\u8499\u7279\u5361\u7f57\u65b9\u6cd5\u5229\u7528\u4e86\u6982\u7387\u8bba\uff0c\u76f4\u89c2\u4e14\u6613\u4e8e\u5b9e\u73b0\uff0c\u4f46\u9700\u8981\u5927\u91cf\u6837\u672c\u6765\u63d0\u9ad8\u7cbe\u5ea6\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528\u5916\u90e8API<\/h3>\n<\/p>\n<p><p>\u6709\u4e9b\u65f6\u5019\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5229\u7528\u5728\u7ebf\u670d\u52a1\u6765\u83b7\u53d6\u5706\u5468\u7387\u7684\u503c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u4ee5\u4f7f\u7528\u7684API\uff1a<\/p>\n<\/p>\n<p><h4>1. pi.delivery API<\/h4>\n<\/p>\n<p><p>pi.delivery \u662f\u4e00\u4e2a\u514d\u8d39\u7684API\uff0c\u53ef\u4ee5\u8fd4\u56de\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>response = requests.get(&#39;https:\/\/api.pi.delivery\/v1\/pi?start=0&amp;numberOfDigits=1000&#39;)<\/p>\n<p>pi_value = response.json()[&#39;content&#39;]<\/p>\n<p>print(pi_value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8be6\u7ec6\u89e3\u91ca<\/h4>\n<\/p>\n<p><p><strong>\u5916\u90e8API<\/strong> \u63d0\u4f9b\u4e86\u65b9\u4fbf\u548c\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c\uff0c\u7279\u522b\u662f\u5728\u9700\u8981\u8d85\u9ad8\u7cbe\u5ea6\u7684\u60c5\u51b5\u4e0b\u975e\u5e38\u6709\u7528\u3002\u901a\u8fc7\u8bf7\u6c42API\uff0c\u4f60\u53ef\u4ee5\u5f97\u5230\u4e0a\u5343\u4f4d\u751a\u81f3\u66f4\u591a\u4f4d\u7684\u5706\u5468\u7387\u503c\uff0c\u8fd9\u5728\u67d0\u4e9b\u79d1\u5b66\u8ba1\u7b97\u548c\u7814\u7a76\u4e2d\u53ef\u80fd\u662f\u5fc5\u8981\u7684\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u83b7\u53d6\u548c\u6253\u5370\u5706\u5468\u7387\uff0c\u5305\u62ec\u4f7f\u7528\u6807\u51c6\u5e93\uff08\u5982<code>math<\/code>\u6a21\u5757\uff09\u3001\u7b2c\u4e09\u65b9\u5e93\uff08\u5982<code>NumPy<\/code>\u548c<code>SymPy<\/code>\uff09\u3001\u81ea\u5b9a\u4e49\u7b97\u6cd5\uff08\u5982\u83b1\u5e03\u5c3c\u8328\u7ea7\u6570\u548c\u8499\u7279\u5361\u7f57\u65b9\u6cd5\uff09\u3001\u4ee5\u53ca\u5916\u90e8API\u3002\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p><strong>\u6838\u5fc3\u89c2\u70b9\u603b\u7ed3<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u6807\u51c6\u5e93\u7684math\u6a21\u5757\u7b80\u5355\u4e14\u9ad8\u6548<\/strong>\u3002<\/li>\n<li><strong>NumPy\u63d0\u4f9b\u4e86\u66f4\u5e7f\u6cdb\u7684\u79d1\u5b66\u8ba1\u7b97\u529f\u80fd<\/strong>\u3002<\/li>\n<li><strong>SymPy\u80fd\u591f\u8fdb\u884c\u9ad8\u7cbe\u5ea6\u7684\u7b26\u53f7\u8ba1\u7b97<\/strong>\u3002<\/li>\n<li><strong>\u81ea\u5b9a\u4e49\u7b97\u6cd5\u63d0\u4f9b\u4e86\u6df1\u5165\u7406\u89e3\u5706\u5468\u7387\u8ba1\u7b97\u7684\u673a\u4f1a<\/strong>\u3002<\/li>\n<li><strong>\u5916\u90e8API\u53ef\u4ee5\u63d0\u4f9b\u8d85\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u503c<\/strong>\u3002<\/li>\n<\/ul>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4ee5\u4e0d\u540c\u7684\u7cbe\u5ea6\u6253\u5370\u5706\u5468\u7387\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>math<\/code>\u6a21\u5757\u6765\u83b7\u53d6\u5706\u5468\u7387\u7684\u503c\u3002\u901a\u8fc7\u8c03\u7528<code>math.pi<\/code>\u53ef\u4ee5\u5f97\u5230\u5706\u5468\u7387\u7684\u8fd1\u4f3c\u503c\u3002\u5982\u679c\u9700\u8981\u4ee5\u7279\u5b9a\u7684\u7cbe\u5ea6\u6253\u5370\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\u3002\u4f8b\u5982\uff0c\u8981\u6253\u5370\u51fa\u5706\u5468\u7387\u5230\u5c0f\u6570\u70b9\u540e\u4e24\u4f4d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import math\nprint(f&quot;{math.pi:.2f}&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u8f93\u51fa3.14\u3002<\/p>\n<p><strong>\u53ef\u4ee5\u5728Python\u4e2d\u4f7f\u7528\u54ea\u4e9b\u5e93\u6765\u83b7\u53d6\u66f4\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\uff1f<\/strong><br \/>\u5bf9\u4e8e\u9700\u8981\u66f4\u9ad8\u7cbe\u5ea6\u7684\u5706\u5468\u7387\u8ba1\u7b97\uff0c\u53ef\u4ee5\u4f7f\u7528<code>mpmath<\/code>\u5e93\u3002\u8fd9\u4e2a\u5e93\u652f\u6301\u4efb\u610f\u7cbe\u5ea6\u7684\u6d6e\u70b9\u6570\u8fd0\u7b97\uff0c\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">from mpmath import mp\nmp.dps = 50  # \u8bbe\u7f6e\u5c0f\u6570\u70b9\u540e50\u4f4d\u7684\u7cbe\u5ea6\nprint(mp.pi)\n<\/code><\/pre>\n<p>\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u8f93\u51fa\u9ad8\u8fbe50\u4f4d\u5c0f\u6570\u7684\u5706\u5468\u7387\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u4f7f\u7528\u5706\u5468\u7387\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\uff1f<\/strong><br \/>\u5706\u5468\u7387\u5728\u8bb8\u591a\u6570\u5b66\u8ba1\u7b97\u4e2d\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\uff0c\u4f8b\u5982\u8ba1\u7b97\u5706\u7684\u9762\u79ef\u6216\u5468\u957f\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u516c\u5f0f\uff1a<\/p>\n<ul>\n<li>\u5706\u7684\u5468\u957f = 2 * \u03c0 * r<\/li>\n<li>\u5706\u7684\u9762\u79ef = \u03c0 * r\u00b2<br \/>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u8ba1\u7b97\u5706\u7684\u5468\u957f\u548c\u9762\u79ef\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-python\">import math\n\nradius = 5\ncircumference = 2 * math.pi * radius\narea = math.pi * (radius ** 2)\n\nprint(f&quot;\u5706\u7684\u5468\u957f: {circumference}&quot;)\nprint(f&quot;\u5706\u7684\u9762\u79ef: {area}&quot;)\n<\/code><\/pre>\n<p>\u4ee5\u4e0a\u4ee3\u7801\u5c06\u8f93\u51fa\u7ed9\u5b9a\u534a\u5f84\u4e3a5\u7684\u5706\u7684\u5468\u957f\u548c\u9762\u79ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u8ba1\u7b97\u548c\u6253\u5370\u5706\u5468\u7387\uff08\u03c0\uff09\u3002 \u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u6807\u51c6\u5e93\u4e2d\u7684\u6570\u5b66\u6a21\u5757\u3001\u7b2c\u4e09\u65b9\u5e93\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1131634,"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\/1131626"}],"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=1131626"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1131626\/revisions"}],"predecessor-version":[{"id":1131638,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1131626\/revisions\/1131638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1131634"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1131626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1131626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1131626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}