{"id":998711,"date":"2024-12-27T09:35:26","date_gmt":"2024-12-27T01:35:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/998711.html"},"modified":"2024-12-27T09:35:29","modified_gmt":"2024-12-27T01:35:29","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e7%bb%9f%e8%ae%a1%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/998711.html","title":{"rendered":"\u5982\u4f55\u7528python\u7edf\u8ba1\u4ee3\u7801"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074033\/697c6cc9-d79d-4235-bf7f-2f2943515b94.webp\" alt=\"\u5982\u4f55\u7528python\u7edf\u8ba1\u4ee3\u7801\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u7edf\u8ba1\u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u3001\u7f16\u5199\u81ea\u5b9a\u4e49\u811a\u672c\u3001\u4f7f\u7528\u5f00\u6e90\u5e93\u3002<\/strong>\u5176\u4e2d\uff0c\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u662f\u6700\u76f4\u63a5\u548c\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u5b83\u4eec\u80fd\u591f\u81ea\u52a8\u751f\u6210\u4ee3\u7801\u7edf\u8ba1\u62a5\u544a\u5e76\u63d0\u4f9b\u8be6\u7ec6\u7684\u5206\u6790\u7ed3\u679c\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u7edf\u8ba1Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177<\/p>\n<\/p>\n<p><p>\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u662f\u8fdb\u884c\u4ee3\u7801\u7edf\u8ba1\u7684\u5e38\u7528\u65b9\u6cd5\u4e4b\u4e00\u3002\u8fd9\u4e9b\u5de5\u5177\u4e0d\u4ec5\u53ef\u4ee5\u5e2e\u52a9\u7edf\u8ba1\u4ee3\u7801\u884c\u6570\uff0c\u8fd8\u80fd\u63d0\u4f9b\u4ee3\u7801\u8d28\u91cf\u5206\u6790\u3001\u4ee3\u7801\u89c4\u8303\u68c0\u67e5\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>Pylint<\/strong><\/li>\n<\/ol>\n<p><p>Pylint\u662f\u4e00\u6b3e\u975e\u5e38\u6d41\u884c\u7684Python\u4ee3\u7801\u5206\u6790\u5de5\u5177\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u68c0\u67e5\u4ee3\u7801\u7684\u9519\u8bef\uff0c\u8fd8\u53ef\u4ee5\u7edf\u8ba1\u4ee3\u7801\u884c\u6570\u3001\u6ce8\u91ca\u884c\u6570\u7b49\u3002Pylint\u7684\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pylint your_script.py<\/code>\u5373\u53ef\u83b7\u5f97\u8be6\u7ec6\u7684\u4ee3\u7801\u7edf\u8ba1\u4fe1\u606f\u3002\u9664\u4e86\u884c\u6570\u7edf\u8ba1\uff0cPylint\u8fd8\u63d0\u4f9b\u4e86\u4ee3\u7801\u590d\u6742\u5ea6\u5206\u6790\u548c\u4ee3\u7801\u98ce\u683c\u68c0\u67e5\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>Radon<\/strong><\/li>\n<\/ol>\n<p><p>Radon\u662f\u4e00\u4e2a\u7528\u4e8e\u8ba1\u7b97Python\u4ee3\u7801\u590d\u6742\u5ea6\u3001\u7ef4\u62a4\u6027\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u7684\u5de5\u5177\u3002Radon\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u63a5\u53e3\u8fd0\u884c\uff0c\u5e76\u751f\u6210\u8be6\u7ec6\u7684\u4ee3\u7801\u7edf\u8ba1\u62a5\u544a\u3002\u4f7f\u7528Radon\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u5730\u83b7\u53d6\u4ee3\u7801\u7684\u884c\u6570\u3001\u6ce8\u91ca\u884c\u6570\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\uff0c\u5e76\u80fd\u591f\u5206\u6790\u4ee3\u7801\u7684\u590d\u6742\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u7f16\u5199\u81ea\u5b9a\u4e49\u811a\u672c<\/p>\n<\/p>\n<p><p>\u5982\u679c\u4ec5\u9700\u8981\u7edf\u8ba1\u4ee3\u7801\u884c\u6570\u548c\u6ce8\u91ca\u884c\u6570\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u7b80\u5355\u7684Python\u811a\u672c\u6765\u5b9e\u73b0\u3002\u8fd9\u79cd\u65b9\u6cd5\u7075\u6d3b\u6027\u9ad8\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u5b9a\u5236\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7edf\u8ba1\u4ee3\u7801\u884c\u6570<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>os<\/code>\u548c<code>re<\/code>\u6a21\u5757\u7f16\u5199\u811a\u672c\uff0c\u9012\u5f52\u904d\u5386\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6240\u6709Python\u6587\u4ef6\uff0c\u9010\u884c\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u7edf\u8ba1\u884c\u6570\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u6613\u884c\uff0c\u9002\u7528\u4e8e\u57fa\u672c\u7684\u4ee3\u7801\u7edf\u8ba1\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>def count_lines_in_file(file_path):<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        return len(file.readlines())<\/p>\n<p>def count_lines_in_directory(directory_path):<\/p>\n<p>    total_lines = 0<\/p>\n<p>    for root, _, files in os.walk(directory_path):<\/p>\n<p>        for file in files:<\/p>\n<p>            if file.endswith(&#39;.py&#39;):<\/p>\n<p>                file_path = os.path.join(root, file)<\/p>\n<p>                total_lines += count_lines_in_file(file_path)<\/p>\n<p>    return total_lines<\/p>\n<p>directory_path = &#39;your_directory_path&#39;<\/p>\n<p>total_lines = count_lines_in_directory(directory_path)<\/p>\n<p>print(f&#39;Total lines of code: {total_lines}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u7edf\u8ba1\u6ce8\u91ca\u884c\u6570<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u6b63\u5219\u8868\u8fbe\u5f0f\u8bc6\u522b\u6ce8\u91ca\u884c\uff0c\u5e76\u5728\u7edf\u8ba1\u4ee3\u7801\u884c\u6570\u7684\u57fa\u7840\u4e0a\u589e\u52a0\u6ce8\u91ca\u884c\u6570\u7684\u7edf\u8ba1\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u51c6\u786e\u7edf\u8ba1Python\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u884c\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>def count_comment_lines_in_file(file_path):<\/p>\n<p>    comment_line_count = 0<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        for line in file:<\/p>\n<p>            if re.match(r&#39;^\\s*#&#39;, line):<\/p>\n<p>                comment_line_count += 1<\/p>\n<p>    return comment_line_count<\/p>\n<p>def count_comment_lines_in_directory(directory_path):<\/p>\n<p>    total_comment_lines = 0<\/p>\n<p>    for root, _, files in os.walk(directory_path):<\/p>\n<p>        for file in files:<\/p>\n<p>            if file.endswith(&#39;.py&#39;):<\/p>\n<p>                file_path = os.path.join(root, file)<\/p>\n<p>                total_comment_lines += count_comment_lines_in_file(file_path)<\/p>\n<p>    return total_comment_lines<\/p>\n<p>total_comment_lines = count_comment_lines_in_directory(directory_path)<\/p>\n<p>print(f&#39;Total comment lines: {total_comment_lines}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u5f00\u6e90\u5e93<\/p>\n<\/p>\n<p><p>Python\u793e\u533a\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f00\u6e90\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u4ee3\u7801\u7edf\u8ba1\u548c\u5206\u6790\u3002\u8fd9\u4e9b\u5e93\u901a\u5e38\u529f\u80fd\u5f3a\u5927\uff0c\u80fd\u591f\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>tokenize\u6a21\u5757<\/strong><\/li>\n<\/ol>\n<p><p>Python\u7684\u5185\u7f6e<code>tokenize<\/code>\u6a21\u5757\u53ef\u4ee5\u7528\u4e8e\u5206\u6790Python\u6e90\u4ee3\u7801\u7684\u8bed\u6cd5\u7ed3\u6784\u3002\u901a\u8fc7\u4f7f\u7528<code>tokenize<\/code>\u6a21\u5757\uff0c\u53ef\u4ee5\u7edf\u8ba1\u4ee3\u7801\u4e2d\u4e0d\u540c\u7c7b\u578b\u7684\u8bed\u6cd5\u5143\u7d20\uff08\u5982\u5173\u952e\u5b57\u3001\u6807\u8bc6\u7b26\u3001\u64cd\u4f5c\u7b26\u7b49\uff09\u7684\u6570\u91cf\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u5408\u9700\u8981\u6df1\u5165\u5206\u6790\u4ee3\u7801\u7ed3\u6784\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tokenize<\/p>\n<p>def count_tokens_in_file(file_path):<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        tokens = list(tokenize.generate_tokens(file.readline))<\/p>\n<p>        return len(tokens)<\/p>\n<p>total_tokens = count_tokens_in_file(&#39;your_script.py&#39;)<\/p>\n<p>print(f&#39;Total tokens: {total_tokens}&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>CodeAnalysis\u5e93<\/strong><\/li>\n<\/ol>\n<p><p>CodeAnalysis\u662f\u4e00\u4e2a\u7528\u4e8ePython\u4ee3\u7801\u5206\u6790\u7684\u5e93\uff0c\u652f\u6301\u4ee3\u7801\u590d\u6742\u5ea6\u3001\u884c\u6570\u3001\u6ce8\u91ca\u884c\u6570\u7b49\u591a\u79cd\u7edf\u8ba1\u529f\u80fd\u3002\u901a\u8fc7CodeAnalysis\u5e93\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u751f\u6210\u4ee3\u7801\u7edf\u8ba1\u62a5\u544a\uff0c\u5e76\u53ef\u89c6\u5316\u4ee3\u7801\u7684\u590d\u6742\u5ea6\u548c\u8d28\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u5b9e\u73b0\u66f4\u5168\u9762\u7684\u4ee3\u7801\u7edf\u8ba1\u548c\u5206\u6790\u3002\u901a\u8fc7\u5c06\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u3001\u81ea\u5b9a\u4e49\u811a\u672c\u548c\u5f00\u6e90\u5e93\u7ed3\u5408\u4f7f\u7528\uff0c\u53ef\u4ee5\u83b7\u5f97\u66f4\u8be6\u7ec6\u7684\u4ee3\u7801\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ece\u800c\u66f4\u597d\u5730\u7406\u89e3\u4ee3\u7801\u8d28\u91cf\u548c\u590d\u6742\u5ea6\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7efc\u5408\u4f7f\u7528Pylint\u548cRadon<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u5148\u4f7f\u7528Pylint\u8fdb\u884c\u4ee3\u7801\u8d28\u91cf\u548c\u98ce\u683c\u68c0\u67e5\uff0c\u83b7\u53d6\u4ee3\u7801\u884c\u6570\u548c\u6ce8\u91ca\u884c\u6570\u7684\u57fa\u672c\u7edf\u8ba1\u4fe1\u606f\u3002\u7136\u540e\uff0c\u4f7f\u7528Radon\u8fdb\u4e00\u6b65\u5206\u6790\u4ee3\u7801\u7684\u590d\u6742\u5ea6\u548c\u53ef\u7ef4\u62a4\u6027\uff0c\u751f\u6210\u66f4\u8be6\u7ec6\u7684\u4ee3\u7801\u7edf\u8ba1\u62a5\u544a\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5168\u9762\u8bc4\u4f30\u4ee3\u7801\u8d28\u91cf\uff0c\u5e76\u8bc6\u522b\u6f5c\u5728\u7684\u4f18\u5316\u673a\u4f1a\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u81ea\u5b9a\u4e49\u811a\u672c\u4e0e\u5f00\u6e90\u5e93\u7ed3\u5408<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49\u811a\u672c\u4e2d\u8c03\u7528\u5f00\u6e90\u5e93\u7684\u529f\u80fd\uff0c\u6269\u5c55\u4ee3\u7801\u7edf\u8ba1\u7684\u80fd\u529b\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u7edf\u8ba1\u4ee3\u7801\u884c\u6570\u7684\u811a\u672c\u4e2d\u96c6\u6210<code>tokenize<\/code>\u6a21\u5757\uff0c\u5206\u6790\u4ee3\u7801\u7684\u8bed\u6cd5\u7ed3\u6784\uff1b\u6216\u8005\u4f7f\u7528CodeAnalysis\u5e93\u751f\u6210\u53ef\u89c6\u5316\u7684\u4ee3\u7801\u7edf\u8ba1\u62a5\u544a\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u7075\u6d3b\u5b9a\u5236\u4ee3\u7801\u7edf\u8ba1\u548c\u5206\u6790\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u7ed3\u8bba<\/p>\n<\/p>\n<p><p>\u7edf\u8ba1Python\u4ee3\u7801\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u4efb\u52a1\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u7406\u89e3\u4ee3\u7801\u8d28\u91cf\u548c\u590d\u6742\u5ea6\u3002\u901a\u8fc7\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u3001\u7f16\u5199\u81ea\u5b9a\u4e49\u811a\u672c\u548c\u4f7f\u7528\u5f00\u6e90\u5e93\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5b9e\u73b0\u4ee3\u7801\u7edf\u8ba1\u548c\u5206\u6790\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u4ee5\u83b7\u5f97\u66f4\u5168\u9762\u548c\u8be6\u7ec6\u7684\u4ee3\u7801\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u7528Python\u7edf\u8ba1\u4ee3\u7801\u7684\u884c\u6570\u548c\u590d\u6742\u5ea6\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u7edf\u8ba1Python\u4ee3\u7801\u7684\u884c\u6570\u548c\u590d\u6742\u5ea6\u3002\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Python\u5185\u7f6e\u7684<code>len()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u4ee3\u7801\u6587\u4ef6\u4e2d\u7684\u884c\u6570\u3002\u5bf9\u4e8e\u590d\u6742\u5ea6\u7684\u7edf\u8ba1\uff0c\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982<code>radon<\/code>\uff0c\u5b83\u80fd\u591f\u5206\u6790\u4ee3\u7801\u7684\u590d\u6742\u5ea6\u3001\u5708\u590d\u6742\u5ea6\u7b49\u6307\u6807\u3002\u53ea\u9700\u5b89\u88c5<code>radon<\/code>\uff0c\u7136\u540e\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6216\u5728\u4ee3\u7801\u4e2d\u8c03\u7528\u76f8\u5e94\u51fd\u6570\u5373\u53ef\u83b7\u53d6\u6240\u9700\u6570\u636e\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u6211\u7edf\u8ba1Python\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u548c\u7a7a\u884c\uff1f<\/strong><br \/>\u5f88\u591a\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5206\u6790Python\u4ee3\u7801\u7684\u7ed3\u6784\u3002\u4f8b\u5982\uff0c<code>cloc<\/code>\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7edf\u8ba1\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u3001\u7a7a\u884c\u548c\u5b9e\u9645\u4ee3\u7801\u884c\u6570\u3002\u6b64\u5916\uff0c<code>pycodestyle<\/code>\u548c<code>pylint<\/code>\u7b49\u5de5\u5177\u4e5f\u63d0\u4f9b\u4ee3\u7801\u5206\u6790\u529f\u80fd\uff0c\u80fd\u591f\u5e2e\u52a9\u4f60\u8bc6\u522b\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u548c\u7a7a\u884c\uff0c\u5e76\u7ed9\u51fa\u76f8\u5e94\u7684\u7edf\u8ba1\u7ed3\u679c\u3002<\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7Python\u811a\u672c\u81ea\u52a8\u7edf\u8ba1\u9879\u76ee\u4e2d\u7684\u4ee3\u7801\u884c\u6570\uff1f<\/strong><br \/>\u4f60\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u6765\u904d\u5386\u9879\u76ee\u4e2d\u7684\u6240\u6709Python\u6587\u4ef6\uff0c\u5e76\u7edf\u8ba1\u6bcf\u4e2a\u6587\u4ef6\u7684\u884c\u6570\u3002\u4f7f\u7528<code>os<\/code>\u6a21\u5757\u53ef\u4ee5\u904d\u5386\u6587\u4ef6\u7cfb\u7edf\uff0c\u800c<code>open()<\/code>\u51fd\u6570\u53ef\u4ee5\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u3002\u7ed3\u5408\u8fd9\u4e9b\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u81ea\u52a8\u5316\u7edf\u8ba1\uff0c\u751a\u81f3\u5c06\u7ed3\u679c\u8f93\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4fbf\u4e8e\u540e\u7eed\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u7edf\u8ba1\u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5\u5177\u3001\u7f16\u5199\u81ea\u5b9a\u4e49\u811a\u672c\u3001\u4f7f\u7528\u5f00\u6e90\u5e93\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u9759\u6001\u4ee3\u7801\u5206\u6790\u5de5 [&hellip;]","protected":false},"author":3,"featured_media":998721,"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\/998711"}],"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=998711"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/998711\/revisions"}],"predecessor-version":[{"id":998724,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/998711\/revisions\/998724"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/998721"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=998711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=998711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=998711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}