{"id":1004012,"date":"2024-12-27T10:22:26","date_gmt":"2024-12-27T02:22:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1004012.html"},"modified":"2024-12-27T10:22:33","modified_gmt":"2024-12-27T02:22:33","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e8%af%bb%e5%8f%96%e4%b8%ad%e6%96%87","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1004012.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u8bfb\u53d6\u4e2d\u6587"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081130\/4ad5062d-43e7-4003-9c1c-60067c687fee.webp\" alt=\"python\u4e2d\u5982\u4f55\u8bfb\u53d6\u4e2d\u6587\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u8bfb\u53d6\u4e2d\u6587\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u5408\u9002\u7684\u7f16\u7801\u65b9\u5f0f\u3001\u786e\u4fdd\u6587\u4ef6\u7684\u7f16\u7801\u6b63\u786e\u3001\u4f7f\u7528\u6b63\u786e\u7684\u6587\u4ef6\u8bfb\u53d6\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u6765\u5b9e\u73b0\uff1a\u9009\u62e9\u6b63\u786e\u7684\u7f16\u7801\u65b9\u5f0f\u3001\u4f7f\u7528Python\u5185\u7f6e\u7684\u7f16\u7801\u51fd\u6570\u3001\u5904\u7406\u6f5c\u5728\u7684\u7f16\u7801\u9519\u8bef\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u9009\u62e9\u6b63\u786e\u7684\u7f16\u7801\u65b9\u5f0f\u662f\u5173\u952e\uff0c\u56e0\u4e3a\u4e2d\u6587\u5b57\u7b26\u901a\u5e38\u4f7f\u7528UTF-8\u6216GBK\u7f16\u7801\u3002\u5728Python\u4e2d\uff0c\u8bfb\u53d6\u6587\u4ef6\u65f6\u9700\u8981\u6307\u5b9a\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u3002\u901a\u5e38\u63a8\u8350\u4f7f\u7528UTF-8\u7f16\u7801\uff0c\u56e0\u4e3a\u5b83\u5177\u6709\u66f4\u5e7f\u6cdb\u7684\u517c\u5bb9\u6027\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>open<\/code>\u51fd\u6570\u7684<code>encoding<\/code>\u53c2\u6570\u6765\u6307\u5b9a\u7f16\u7801\u65b9\u5f0f\uff0c\u5982<code>open(&#39;\u6587\u4ef6\u540d&#39;, encoding=&#39;utf-8&#39;)<\/code>\u3002\u5728\u786e\u4fdd\u7f16\u7801\u6b63\u786e\u4e4b\u540e\uff0cPython\u80fd\u591f\u6b63\u786e\u8bfb\u53d6\u548c\u5904\u7406\u6587\u4ef6\u4e2d\u7684\u4e2d\u6587\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u8ba8\u8bba\u5728Python\u4e2d\u8bfb\u53d6\u4e2d\u6587\u7684\u5177\u4f53\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9009\u62e9\u6b63\u786e\u7684\u7f16\u7801\u65b9\u5f0f<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u4e2d\u6587\u6587\u672c\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684\u7f16\u7801\u65b9\u5f0f\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002UTF-8\u548cGBK\u662f\u5e38\u7528\u7684\u4e2d\u6587\u7f16\u7801\u683c\u5f0f\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>UTF-8\u7f16\u7801<\/strong>\uff1aUTF-8\u662f\u4e00\u79cd\u53ef\u53d8\u957f\u5ea6\u7684\u5b57\u7b26\u7f16\u7801\uff0c\u5177\u6709\u5e7f\u6cdb\u7684\u517c\u5bb9\u6027\uff0c\u9002\u7528\u4e8e\u51e0\u4e4e\u6240\u6709\u8bed\u8a00\u7684\u5b57\u7b26\u3002\u56e0\u6b64\uff0cUTF-8\u662f\u5904\u7406\u4e2d\u6587\u6587\u4ef6\u65f6\u63a8\u8350\u7684\u7f16\u7801\u65b9\u5f0f\u3002\u5b83\u53ef\u4ee5\u5728\u5168\u7403\u8303\u56f4\u5185\u5904\u7406\u591a\u8bed\u8a00\u6587\u672c\uff0c\u4e14\u4e0eASCII\u5b8c\u5168\u517c\u5bb9\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>GBK\u7f16\u7801<\/strong>\uff1aGBK\u662f\u4e2d\u56fd\u56fd\u5bb6\u6807\u51c6GB2312\u7684\u6269\u5c55\uff0c\u662f\u4e00\u79cd\u517c\u5bb9\u7b80\u4f53\u4e2d\u6587\u7684\u5b57\u7b26\u7f16\u7801\u3002\u867d\u7136GBK\u53ef\u4ee5\u5904\u7406\u4e2d\u6587\u5b57\u7b26\uff0c\u4f46\u5728\u56fd\u9645\u5316\u652f\u6301\u4e0a\u4e0d\u5982UTF-8\u5e7f\u6cdb\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u7f16\u7801\u65b9\u5f0f\u53ef\u4ee5\u786e\u4fdd\u6587\u672c\u7684\u6b63\u786e\u8bfb\u53d6\u548c\u663e\u793a\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528UTF-8\u53ef\u4ee5\u907f\u514d\u8bb8\u591a\u4e0d\u5fc5\u8981\u7684\u7f16\u7801\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Python\u5185\u7f6e\u7684\u7f16\u7801\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6\u65f6\uff0c<code>open<\/code>\u51fd\u6570\u7684<code>encoding<\/code>\u53c2\u6570\u53ef\u4ee5\u7528\u4e8e\u6307\u5b9a\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528UTF-8\u7f16\u7801\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u907f\u514d\u7531\u4e8e\u7f16\u7801\u4e0d\u5339\u914d\u800c\u5bfc\u81f4\u7684\u8bfb\u53d6\u9519\u8bef\u3002\u901a\u8fc7\u6307\u5b9a\u7f16\u7801\uff0cPython\u4f1a\u5728\u8bfb\u53d6\u6587\u4ef6\u65f6\u81ea\u52a8\u8fdb\u884c\u7f16\u7801\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5904\u7406\u6f5c\u5728\u7684\u7f16\u7801\u9519\u8bef<\/h3>\n<\/p>\n<p><p>\u5728\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7f16\u7801\u9519\u8bef\u3002\u4e3a\u4e86\u66f4\u597d\u5730\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\uff0c\u53ef\u4ee5\u5728\u6253\u5f00\u6587\u4ef6\u65f6\u4f7f\u7528<code>errors<\/code>\u53c2\u6570\u6765\u6307\u5b9a\u9519\u8bef\u5904\u7406\u7b56\u7565\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>&#39;ignore&#39;\u7b56\u7565<\/strong>\uff1a\u5ffd\u7565\u65e0\u6cd5\u89e3\u7801\u7684\u5b57\u7b26<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;, errors=&#39;ignore&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li><strong>&#39;replace&#39;\u7b56\u7565<\/strong>\uff1a\u7528\u66ff\u4ee3\u5b57\u7b26\u66ff\u6362\u65e0\u6cd5\u89e3\u7801\u7684\u5b57\u7b26<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;, errors=&#39;replace&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528\u8fd9\u4e9b\u7b56\u7565\u53ef\u4ee5\u9632\u6b62\u7a0b\u5e8f\u56e0\u7f16\u7801\u9519\u8bef\u800c\u5d29\u6e83\uff0c\u4f46\u53ef\u80fd\u4f1a\u4e22\u5931\u6216\u66ff\u6362\u90e8\u5206\u5b57\u7b26\u3002\u56e0\u6b64\uff0c\u5e94\u5c3d\u91cf\u786e\u4fdd\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u786e\u4fdd\u6587\u4ef6\u7684\u7f16\u7801\u6b63\u786e<\/h3>\n<\/p>\n<p><p>\u5728\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6\u4e4b\u524d\uff0c\u786e\u4fdd\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u6b63\u786e\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216\u7f16\u7801\u68c0\u6d4b\u5de5\u5177\u6765\u68c0\u67e5\u548c\u4fee\u6539\u6587\u4ef6\u7684\u7f16\u7801\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668<\/strong>\uff1a\u5927\u591a\u6570\u73b0\u4ee3\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VSCode\u3001Sublime Text\uff09\u652f\u6301\u67e5\u770b\u548c\u66f4\u6539\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u3002\u53ef\u4ee5\u5728\u4fdd\u5b58\u6587\u4ef6\u65f6\u9009\u62e9UTF-8\u7f16\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u7f16\u7801\u68c0\u6d4b\u5de5\u5177<\/strong>\uff1a\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>chardet<\/code>\u5e93\u6765\u68c0\u6d4b\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import chardet<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;rb&#39;) as file:<\/p>\n<p>    data = file.read()<\/p>\n<p>    result = chardet.detect(data)<\/p>\n<p>    encoding = result[&#39;encoding&#39;]<\/p>\n<p>    print(f&quot;Detected encoding: {encoding}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u68c0\u6d4b\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\uff0c\u53ef\u4ee5\u66f4\u51c6\u786e\u5730\u6307\u5b9a\u8bfb\u53d6\u65f6\u6240\u9700\u7684\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5904\u7406\u4e0d\u540c\u6765\u6e90\u7684\u4e2d\u6587\u6587\u672c<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e2d\u6587\u6587\u672c\u53ef\u80fd\u6765\u81ea\u4e0d\u540c\u7684\u6765\u6e90\uff0c\u5982\u7f51\u9875\u3001\u6570\u636e\u5e93\u3001API\u7b49\u3002\u5904\u7406\u8fd9\u4e9b\u6587\u672c\u65f6\uff0c\u540c\u6837\u9700\u8981\u6ce8\u610f\u7f16\u7801\u95ee\u9898\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>\u7f51\u9875\u6570\u636e<\/strong>\uff1a\u4ece\u7f51\u9875\u4e0a\u6293\u53d6\u7684\u6587\u672c\u901a\u5e38\u662fHTML\u7f16\u7801\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528<code>requests<\/code>\u5e93\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff0c\u5e76\u901a\u8fc7<code>response.encoding<\/code>\u5c5e\u6027\u6765\u8bbe\u7f6e\u6b63\u786e\u7684\u7f16\u7801\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>response = requests.get(&#39;http:\/\/example.com&#39;)<\/p>\n<p>response.encoding = &#39;utf-8&#39;<\/p>\n<p>content = response.text<\/p>\n<p>print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\n<p><strong>\u6570\u636e\u5e93\u6570\u636e<\/strong>\uff1a\u5728\u4ece\u6570\u636e\u5e93\u8bfb\u53d6\u4e2d\u6587\u6570\u636e\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u6570\u636e\u5e93\u8fde\u63a5\u914d\u7f6e\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u4e0e\u6570\u636e\u5b58\u50a8\u7684\u5b57\u7b26\u96c6\u4e00\u81f4\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>API\u6570\u636e<\/strong>\uff1a\u901a\u8fc7API\u83b7\u53d6\u7684\u4e2d\u6587\u6570\u636e\u901a\u5e38\u662fJSON\u683c\u5f0f\uff0c\u786e\u4fddAPI\u54cd\u5e94\u5934\u4e2d\u6307\u5b9a\u7684\u7f16\u7801\u683c\u5f0f\u4e0e\u5b9e\u9645\u7f16\u7801\u4e00\u81f4\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h3>\u516d\u3001\u6587\u672c\u5904\u7406\u4e2d\u7684\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><p>\u5728\u8bfb\u53d6\u4e2d\u6587\u6587\u672c\u540e\uff0c\u53ef\u80fd\u9700\u8981\u5bf9\u6587\u672c\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5904\u7406\uff0c\u5982\u5206\u8bcd\u3001\u5206\u6790\u7b49\u3002\u5728\u8fd9\u4e9b\u64cd\u4f5c\u4e2d\uff0c\u4ecd\u9700\u6ce8\u610f\u7f16\u7801\u548c\u5b57\u7b26\u5904\u7406\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>\u4e2d\u6587\u5206\u8bcd<\/strong>\uff1a\u53ef\u4ee5\u4f7f\u7528<code>jieba<\/code>\u5e93\u8fdb\u884c\u4e2d\u6587\u5206\u8bcd\u3002\u8be5\u5e93\u652f\u6301UTF-8\u7f16\u7801\u7684\u6587\u672c\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import jieba<\/p>\n<p>text = &quot;\u4eca\u5929\u5929\u6c14\u4e0d\u9519&quot;<\/p>\n<p>words = jieba.lcut(text)<\/p>\n<p>print(words)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li><strong>\u6b63\u5219\u8868\u8fbe\u5f0f<\/strong>\uff1a\u5728\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5904\u7406\u4e2d\u6587\u6587\u672c\u65f6\uff0c\u5e94\u786e\u4fdd\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u548c\u6587\u672c\u7f16\u7801\u4e00\u81f4\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>pattern = re.compile(r&#39;[\\u4e00-\\u9fa5]+&#39;)<\/p>\n<p>matches = pattern.findall(&#39;\u4e2d\u6587\u5b57\u7b26&#39;)<\/p>\n<p>print(matches)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5728Python\u4e2d\u8bfb\u53d6\u548c\u5904\u7406\u4e2d\u6587\u6587\u672c\uff0c\u907f\u514d\u7f16\u7801\u95ee\u9898\u5e26\u6765\u7684\u56f0\u6270\u3002\u65e0\u8bba\u662f\u5904\u7406\u672c\u5730\u6587\u4ef6\u8fd8\u662f\u7f51\u7edc\u6570\u636e\uff0c\u9009\u62e9\u6b63\u786e\u7684\u7f16\u7801\u65b9\u5f0f\u548c\u5904\u7406\u7b56\u7565\u90fd\u662f\u786e\u4fdd\u4e2d\u6587\u6587\u672c\u5904\u7406\u6210\u529f\u7684\u5173\u952e\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u6b63\u786e\u5904\u7406\u548c\u8bfb\u53d6\u4e2d\u6587\u5b57\u7b26\uff1f<\/strong><br \/>\u5728Python\u4e2d\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u65f6\uff0c\u786e\u4fdd\u4f7f\u7528\u5408\u9002\u7684\u7f16\u7801\u65b9\u5f0f\u662f\u5173\u952e\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528UTF-8\u7f16\u7801\u53ef\u4ee5\u6709\u6548\u5730\u8bfb\u53d6\u548c\u663e\u793a\u4e2d\u6587\u5185\u5bb9\u3002\u5728\u6253\u5f00\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a\u7f16\u7801\u53c2\u6570\u6765\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>open(&#39;\u6587\u4ef6\u540d&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;)<\/code>\u6765\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6\u3002<\/p>\n<p><strong>\u5982\u679c\u8bfb\u53d6\u7684\u4e2d\u6587\u6587\u4ef6\u5305\u542b\u4e71\u7801\uff0c\u5e94\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5f53\u8bfb\u53d6\u4e2d\u6587\u6587\u4ef6\u65f6\u9047\u5230\u4e71\u7801\u95ee\u9898\uff0c\u9996\u5148\u9700\u8981\u786e\u8ba4\u6587\u4ef6\u7684\u5b9e\u9645\u7f16\u7801\u683c\u5f0f\u3002\u5982\u679c\u6587\u4ef6\u662f\u4ee5GBK\u6216\u5176\u4ed6\u7f16\u7801\u683c\u5f0f\u4fdd\u5b58\u7684\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u6253\u5f00\u6587\u4ef6\u65f6\u6307\u5b9a\u6b63\u786e\u7684\u7f16\u7801\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>open(&#39;\u6587\u4ef6\u540d&#39;, &#39;r&#39;, encoding=&#39;gbk&#39;)<\/code>\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u67e5\u770b\u6587\u4ef6\u7f16\u7801\uff0c\u786e\u4fdd\u4f60\u7684\u4ee3\u7801\u4e0e\u6587\u4ef6\u7684\u7f16\u7801\u4e00\u81f4\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u5e2e\u52a9\u6211\u5904\u7406\u4e2d\u6587\u6587\u672c\uff1f<\/strong><br \/>Python\u4e2d\u6709\u591a\u4e2a\u5e93\u53ef\u4ee5\u5e2e\u52a9\u5904\u7406\u4e2d\u6587\u6587\u672c\u3002\u4f8b\u5982\uff0c<code>pandas<\/code>\u5e93\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bfb\u53d6\u548c\u64cd\u4f5c\u5e26\u6709\u4e2d\u6587\u7684CSV\u6587\u4ef6\uff1b<code>jieba<\/code>\u5e93\u5219\u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u4e2d\u6587\u5206\u8bcd\u5e93\uff0c\u9002\u5408\u7528\u4e8e\u6587\u672c\u5206\u6790\u548c\u81ea\u7136\u8bed\u8a00\u5904\u7406\u3002\u4f7f\u7528\u8fd9\u4e9b\u5e93\u65f6\uff0c\u786e\u4fdd\u6b63\u786e\u8bbe\u7f6e\u7f16\u7801\uff0c\u4ee5\u786e\u4fdd\u4e2d\u6587\u5b57\u7b26\u80fd\u591f\u88ab\u6b63\u786e\u8bc6\u522b\u548c\u5904\u7406\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8bfb\u53d6\u4e2d\u6587\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u5408\u9002\u7684\u7f16\u7801\u65b9\u5f0f\u3001\u786e\u4fdd\u6587\u4ef6\u7684\u7f16\u7801\u6b63\u786e\u3001\u4f7f\u7528\u6b63\u786e\u7684\u6587\u4ef6\u8bfb\u53d6\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b [&hellip;]","protected":false},"author":3,"featured_media":1004032,"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\/1004012"}],"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=1004012"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1004012\/revisions"}],"predecessor-version":[{"id":1004035,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1004012\/revisions\/1004035"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1004032"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1004012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1004012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1004012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}