{"id":1097120,"date":"2025-01-08T15:08:35","date_gmt":"2025-01-08T07:08:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1097120.html"},"modified":"2025-01-08T15:08:37","modified_gmt":"2025-01-08T07:08:37","slug":"%e5%a6%82%e4%bd%95%e5%b0%86python%e7%9a%84%e5%ad%97%e5%85%b8%e5%ad%98%e5%85%a5txt-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1097120.html","title":{"rendered":"\u5982\u4f55\u5c06Python\u7684\u5b57\u5178\u5b58\u5165TXT"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24212036\/db2af0e5-abf1-46aa-86d8-61a81d80bcf4.webp\" alt=\"\u5982\u4f55\u5c06Python\u7684\u5b57\u5178\u5b58\u5165TXT\" \/><\/p>\n<p><p> <strong>\u4e3a\u4e86\u5c06Python\u7684\u5b57\u5178\u5b58\u5165TXT\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528json\u3001pickle\u3001\u6216\u8005\u76f4\u63a5\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u5199\u5165\u6587\u4ef6\u7684\u65b9\u5f0f\u3002\u4f7f\u7528json\u6a21\u5757\u53ef\u4ee5\u4fdd\u6301\u6570\u636e\u7684\u53ef\u8bfb\u6027\u3001\u4f7f\u7528pickle\u6a21\u5757\u53ef\u4ee5\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\u3001\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5219\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u79cd\u65b9\u6cd5\u7684\u4f18\u7f3a\u70b9\u548c\u5177\u4f53\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528json\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528json\u6a21\u5757\u5c06Python\u5b57\u5178\u5b58\u5165TXT\u6587\u4ef6\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002json\u6a21\u5757\u80fd\u591f\u5c06Python\u5bf9\u8c61\u5e8f\u5217\u5316\u4e3aJSON\u683c\u5f0f\uff0c\u5e76\u5c06\u5176\u5199\u5165\u6587\u4ef6\u3002JSON\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f\uff0c\u5177\u6709\u826f\u597d\u7684\u53ef\u8bfb\u6027\u548c\u8de8\u5e73\u53f0\u6027\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u6613\u8bfb\u6027\u5f3a<\/strong>\uff1aJSON\u683c\u5f0f\u975e\u5e38\u6613\u8bfb\uff0c\u4fbf\u4e8e\u8c03\u8bd5\u548c\u67e5\u770b\u3002<\/li>\n<li><strong>\u8de8\u5e73\u53f0\u652f\u6301<\/strong>\uff1aJSON\u683c\u5f0f\u5728\u4e0d\u540c\u7f16\u7a0b\u8bed\u8a00\u4e2d\u90fd\u5f97\u5230\u5e7f\u6cdb\u652f\u6301\u3002<\/li>\n<\/ul>\n<p><h4>\u7f3a\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4ec5\u652f\u6301\u7b80\u5355\u5bf9\u8c61<\/strong>\uff1aJSON\u53ea\u80fd\u5e8f\u5217\u5316\u7b80\u5355\u7684Python\u5bf9\u8c61\uff0c\u4e0d\u80fd\u5904\u7406\u590d\u6742\u5bf9\u8c61\uff0c\u5982\u81ea\u5b9a\u4e49\u7c7b\u5b9e\u4f8b\u3002<\/li>\n<\/ul>\n<p><h4>\u5b9e\u73b0\u6b65\u9aa4<\/h4>\n<\/p>\n<ol>\n<li>\u5bfc\u5165json\u6a21\u5757\u3002<\/li>\n<li>\u4f7f\u7528json.dumps()\u65b9\u6cd5\u5c06\u5b57\u5178\u8f6c\u6362\u4e3aJSON\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u3002<\/li>\n<li>\u4f7f\u7528open()\u51fd\u6570\u6253\u5f00\u6587\u4ef6\u5e76\u5199\u5165JSON\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import json<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b57\u5178<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;name&#39;: &#39;John Doe&#39;,<\/p>\n<p>    &#39;age&#39;: 28,<\/p>\n<p>    &#39;city&#39;: &#39;New York&#39;<\/p>\n<p>}<\/p>\n<h2><strong>\u5c06\u5b57\u5178\u8f6c\u6362\u4e3aJSON\u5b57\u7b26\u4e32\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;data.txt&#39;, &#39;w&#39;) as file:<\/p>\n<p>    json.dump(data, file)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528json.dump()\u65b9\u6cd5\u5c06\u5b57\u5178\u76f4\u63a5\u5199\u5165\u6587\u4ef6\u3002\u8fd9\u6837\uff0c\u6570\u636e\u53ef\u4ee5\u4ee5JSON\u683c\u5f0f\u5b58\u50a8\u5728TXT\u6587\u4ef6\u4e2d\uff0c\u65b9\u4fbf\u8bfb\u53d6\u548c\u89e3\u6790\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528pickle\u6a21\u5757<\/h3>\n<\/p>\n<p><p>pickle\u6a21\u5757\u662fPython\u5185\u7f6e\u7684\u5e8f\u5217\u5316\u6a21\u5757\uff0c\u53ef\u4ee5\u5c06\u4efb\u610fPython\u5bf9\u8c61\u5e8f\u5217\u5316\u4e3a\u5b57\u8282\u6d41\uff0c\u5e76\u5c06\u5176\u5199\u5165\u6587\u4ef6\u3002\u4f7f\u7528pickle\u6a21\u5757\u53ef\u4ee5\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\uff0c\u5305\u62ec\u81ea\u5b9a\u4e49\u7c7b\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u652f\u6301\u590d\u6742\u5bf9\u8c61<\/strong>\uff1apickle\u53ef\u4ee5\u5e8f\u5217\u5316\u51e0\u4e4e\u6240\u6709\u7684Python\u5bf9\u8c61\uff0c\u5305\u62ec\u81ea\u5b9a\u4e49\u7c7b\u5b9e\u4f8b\u3002<\/li>\n<li><strong>\u9ad8\u6548<\/strong>\uff1apickle\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u901f\u5ea6\u8f83\u5feb\uff0c\u9002\u5408\u5904\u7406\u5927\u91cf\u6570\u636e\u3002<\/li>\n<\/ul>\n<p><h4>\u7f3a\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4e0d\u53ef\u8bfb<\/strong>\uff1apickle\u5e8f\u5217\u5316\u540e\u7684\u6570\u636e\u662f\u4e8c\u8fdb\u5236\u683c\u5f0f\uff0c\u4e0d\u6613\u8bfb\u3002<\/li>\n<li><strong>\u5b89\u5168\u6027<\/strong>\uff1a\u52a0\u8f7d\u4e0d\u53d7\u4fe1\u4efb\u7684\u6570\u636e\u5b58\u5728\u5b89\u5168\u98ce\u9669\u3002<\/li>\n<\/ul>\n<p><h4>\u5b9e\u73b0\u6b65\u9aa4<\/h4>\n<\/p>\n<ol>\n<li>\u5bfc\u5165pickle\u6a21\u5757\u3002<\/li>\n<li>\u4f7f\u7528pickle.dumps()\u65b9\u6cd5\u5c06\u5b57\u5178\u5e8f\u5217\u5316\u4e3a\u5b57\u8282\u6d41\u3002<\/li>\n<li>\u4f7f\u7528open()\u51fd\u6570\u6253\u5f00\u6587\u4ef6\u5e76\u5199\u5165\u5b57\u8282\u6d41\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pickle<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b57\u5178<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;name&#39;: &#39;John Doe&#39;,<\/p>\n<p>    &#39;age&#39;: 28,<\/p>\n<p>    &#39;city&#39;: &#39;New York&#39;<\/p>\n<p>}<\/p>\n<h2><strong>\u5c06\u5b57\u5178\u5e8f\u5217\u5316\u4e3a\u5b57\u8282\u6d41\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;data.pkl&#39;, &#39;wb&#39;) as file:<\/p>\n<p>    pickle.dump(data, file)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528pickle.dump()\u65b9\u6cd5\u5c06\u5b57\u5178\u5e8f\u5217\u5316\u4e3a\u5b57\u8282\u6d41\uff0c\u5e76\u5199\u5165\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u8fd9\u6837\uff0c\u6570\u636e\u53ef\u4ee5\u4ee5\u4e8c\u8fdb\u5236\u683c\u5f0f\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\uff0c\u9002\u5408\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/h3>\n<\/p>\n<p><p>\u5c06\u5b57\u5178\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u5199\u5165TXT\u6587\u4ef6\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u5408\u4fdd\u5b58\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u989d\u5916\u7684\u6a21\u5757\u652f\u6301\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u7b80\u5355\u6613\u7528<\/strong>\uff1a\u4e0d\u9700\u8981\u5f15\u5165\u989d\u5916\u7684\u6a21\u5757\uff0c\u76f4\u63a5\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u5373\u53ef\u5b9e\u73b0\u3002<\/li>\n<li><strong>\u53ef\u8bfb\u6027\u8f83\u597d<\/strong>\uff1a\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u6570\u636e\u6613\u4e8e\u67e5\u770b\u548c\u8c03\u8bd5\u3002<\/li>\n<\/ul>\n<p><h4>\u7f3a\u70b9<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4e0d\u652f\u6301\u590d\u6742\u5bf9\u8c61<\/strong>\uff1a\u53ea\u80fd\u5904\u7406\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\uff0c\u65e0\u6cd5\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\u3002<\/li>\n<li><strong>\u6570\u636e\u8f6c\u6362<\/strong>\uff1a\u8bfb\u53d6\u6570\u636e\u65f6\u9700\u8981\u624b\u52a8\u89e3\u6790\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<p><h4>\u5b9e\u73b0\u6b65\u9aa4<\/h4>\n<\/p>\n<ol>\n<li>\u4f7f\u7528str()\u51fd\u6570\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002<\/li>\n<li>\u4f7f\u7528open()\u51fd\u6570\u6253\u5f00\u6587\u4ef6\u5e76\u5199\u5165\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u5b57\u5178<\/p>\n<p>data = {<\/p>\n<p>    &#39;name&#39;: &#39;John Doe&#39;,<\/p>\n<p>    &#39;age&#39;: 28,<\/p>\n<p>    &#39;city&#39;: &#39;New York&#39;<\/p>\n<p>}<\/p>\n<h2><strong>\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(&#39;data.txt&#39;, &#39;w&#39;) as file:<\/p>\n<p>    file.write(str(data))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528str()\u51fd\u6570\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u5e76\u76f4\u63a5\u5199\u5165TXT\u6587\u4ef6\u3002\u8fd9\u6837\uff0c\u6570\u636e\u53ef\u4ee5\u4ee5\u5b57\u7b26\u4e32\u683c\u5f0f\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\uff0c\u9002\u5408\u4fdd\u5b58\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5c06Python\u7684\u5b57\u5178\u5b58\u5165TXT\u6587\u4ef6\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u573a\u666f\u3002\u4f7f\u7528json\u6a21\u5757\u53ef\u4ee5\u4fdd\u6301\u6570\u636e\u7684\u53ef\u8bfb\u6027\u548c\u8de8\u5e73\u53f0\u652f\u6301\uff0c\u4f46\u53ea\u80fd\u5904\u7406\u7b80\u5355\u5bf9\u8c61\uff1b\u4f7f\u7528pickle\u6a21\u5757\u53ef\u4ee5\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\uff0c\u4f46\u6570\u636e\u4e0d\u53ef\u8bfb\u4e14\u5b58\u5728\u5b89\u5168\u98ce\u9669\uff1b\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u7b80\u5355\u6613\u7528\uff0c\u4f46\u53ea\u80fd\u5904\u7406\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u5982\u679c\u9700\u8981\u4fdd\u5b58\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\uff0c\u5e76\u4e14\u5e0c\u671b\u6570\u636e\u6613\u4e8e\u67e5\u770b\u548c\u8c03\u8bd5\uff0c\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528json\u6a21\u5757\uff1b\u5982\u679c\u9700\u8981\u4fdd\u5b58\u590d\u6742\u7684Python\u5bf9\u8c61\uff0c\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528pickle\u6a21\u5757\uff1b\u5982\u679c\u53ea\u9700\u8981\u4fdd\u5b58\u7b80\u5355\u7684\u5b57\u5178\u6570\u636e\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u989d\u5916\u7684\u6a21\u5757\u652f\u6301\uff0c\u53ef\u4ee5\u9009\u62e9\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u9700\u8981\u6ce8\u610f\u6570\u636e\u7684\u5b89\u5168\u6027\u548c\u53ef\u8bfb\u6027\u3002\u5728\u5904\u7406\u654f\u611f\u6570\u636e\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u52a0\u5bc6\u6280\u672f\u4fdd\u62a4\u6570\u636e\u5b89\u5168\u3002\u5728\u9700\u8981\u8de8\u5e73\u53f0\u652f\u6301\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u6807\u51c6\u7684JSON\u683c\u5f0f\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u5728Python\u4e2d\u5c06\u5b57\u5178\u5b58\u5165TXT\u6587\u4ef6\u7684\u65b9\u6cd5\u9009\u62e9\u548c\u5b9e\u73b0\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06Python\u5b57\u5178\u4fdd\u5b58\u4e3a\u6587\u672c\u6587\u4ef6\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5c06Python\u5b57\u5178\u4fdd\u5b58\u4e3a\u6587\u672c\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528<code>json<\/code>\u6a21\u5757\u3002\u9996\u5148\uff0c\u5c06\u5b57\u5178\u8f6c\u6362\u4e3aJSON\u683c\u5f0f\uff0c\u7136\u540e\u5c06\u5176\u5199\u5165TXT\u6587\u4ef6\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">import json\n\ndata = {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 30, &#39;city&#39;: &#39;New York&#39;}\nwith open(&#39;data.txt&#39;, &#39;w&#39;) as f:\n    json.dump(data, f)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u7684\u597d\u5904\u5728\u4e8e\uff0cJSON\u683c\u5f0f\u6613\u4e8e\u9605\u8bfb\u548c\u89e3\u6790\uff0c\u9002\u5408\u5b58\u50a8\u590d\u6742\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u8bfb\u53d6TXT\u6587\u4ef6\u65f6\u5c06\u5185\u5bb9\u8f6c\u6362\u56dePython\u5b57\u5178\uff1f<\/strong><br \/>\u8bfb\u53d6\u5b58\u50a8\u5728TXT\u6587\u4ef6\u4e2d\u7684\u5b57\u5178\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7684<code>json<\/code>\u6a21\u5757\u3002\u901a\u8fc7<code>json.load()<\/code>\u51fd\u6570\u5c06\u6587\u4ef6\u5185\u5bb9\u8bfb\u53d6\u5e76\u8f6c\u6362\u4e3a\u5b57\u5178\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;data.txt&#39;, &#39;r&#39;) as f:\n    data = json.load(f)\nprint(data)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u786e\u4fdd\u5b57\u5178\u7684\u7ed3\u6784\u548c\u5185\u5bb9\u5728\u5b58\u53d6\u8fc7\u7a0b\u4e2d\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<p><strong>\u5b58\u50a8\u5b57\u5178\u65f6\uff0c\u6709\u54ea\u4e9b\u5176\u4ed6\u683c\u5f0f\u53ef\u4f9b\u9009\u62e9\uff1f<\/strong><br \/>\u9664\u4e86JSON\u683c\u5f0f\u5916\uff0cPython\u5b57\u5178\u8fd8\u53ef\u4ee5\u5b58\u50a8\u4e3a\u5176\u4ed6\u683c\u5f0f\uff0c\u4f8b\u5982CSV\u3001pickle\u6216YAML\u3002\u6bcf\u79cd\u683c\u5f0f\u90fd\u6709\u5176\u9002\u7528\u573a\u666f\u3002CSV\u9002\u5408\u7528\u4e8e\u7b80\u5355\u7684\u952e\u503c\u5bf9\uff0c\u800cpickle\u5219\u9002\u5408\u5b58\u50a8Python\u5bf9\u8c61\u7684\u5b8c\u6574\u72b6\u6001\u3002YAML\u683c\u5f0f\u5219\u66f4\u6613\u4e8e\u9605\u8bfb\uff0c\u5c24\u5176\u5728\u5904\u7406\u590d\u6742\u6570\u636e\u65f6\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u9002\u5408\u7684\u683c\u5f0f\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6570\u636e\u7684\u53ef\u8bfb\u6027\u548c\u517c\u5bb9\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e3a\u4e86\u5c06Python\u7684\u5b57\u5178\u5b58\u5165TXT\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528json\u3001pickle\u3001\u6216\u8005\u76f4\u63a5\u5c06\u5b57\u5178\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u5199\u5165\u6587\u4ef6\u7684 [&hellip;]","protected":false},"author":3,"featured_media":1097128,"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\/1097120"}],"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=1097120"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097120\/revisions"}],"predecessor-version":[{"id":1097130,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097120\/revisions\/1097130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1097128"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1097120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1097120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1097120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}