{"id":1012424,"date":"2024-12-27T11:38:51","date_gmt":"2024-12-27T03:38:51","guid":{"rendered":""},"modified":"2024-12-27T11:38:53","modified_gmt":"2024-12-27T03:38:53","slug":"python%e5%a6%82%e4%bd%95%e6%89%b9%e9%87%8f%e4%bf%9d%e5%ad%98%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1012424.html","title":{"rendered":"python\u5982\u4f55\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25090214\/b07d2348-b7a5-49fc-a795-b9f506b9cc54.webp\" alt=\"python\u5982\u4f55\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5faa\u73af\u3001\u5229\u7528Python\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u5e93\u3001\u501f\u52a9\u5916\u90e8\u5e93\u5982pandas\u548cos\u6a21\u5757\u7b49\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u5faa\u73af\u904d\u5386\u6570\u636e\u5e76\u9010\u4e2a\u4fdd\u5b58\u6587\u4ef6\u3001\u4f7f\u7528os\u6a21\u5757\u521b\u5efa\u76ee\u5f55\u7ed3\u6784\u3001\u5229\u7528pandas\u4fdd\u5b58\u6570\u636e\u6846\u4e3a\u6587\u4ef6\u683c\u5f0f\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u5b9e\u73b0\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5faa\u73af\u904d\u5386\u4e0e\u6587\u4ef6\u4fdd\u5b58<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5faa\u73af\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7ed3\u6784\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u7528\u4e8e\u6279\u91cf\u6587\u4ef6\u4fdd\u5b58\u3002\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u7cfb\u5217\u6570\u636e\u9700\u8981\u4fdd\u5b58\u4e3a\u591a\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7for\u5faa\u73af\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u57fa\u672c\u5faa\u73af\u4fdd\u5b58<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u51c6\u5907\u6570\u636e\uff0c\u5e76\u6307\u5b9a\u4fdd\u5b58\u8def\u5f84\u3002\u53ef\u4ee5\u4f7f\u7528for\u5faa\u73af\u904d\u5386\u6570\u636e\uff0c\u5e76\u4f7f\u7528Python\u7684\u5185\u7f6eopen\u51fd\u6570\u5c06\u6570\u636e\u5199\u5165\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data_list = [&quot;data1&quot;, &quot;data2&quot;, &quot;data3&quot;]<\/p>\n<p>save_path = &quot;output\/&quot;<\/p>\n<p>for i, data in enumerate(data_list):<\/p>\n<p>    file_name = save_path + f&quot;file_{i}.txt&quot;<\/p>\n<p>    with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>        file.write(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>enumerate<\/code>\u51fd\u6570\u7528\u4e8e\u83b7\u53d6\u6570\u636e\u7684\u7d22\u5f15\uff0c\u4ee5\u4fbf\u4e3a\u6bcf\u4e2a\u6587\u4ef6\u547d\u540d\u3002<code>open<\/code>\u51fd\u6570\u4ee5\u5199\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c<code>write<\/code>\u65b9\u6cd5\u5c06\u6570\u636e\u5199\u5165\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u5faa\u73af\u7ed3\u5408\u6761\u4ef6\u4fdd\u5b58<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u6839\u636e\u6761\u4ef6\u7b5b\u9009\u6570\u636e\u5e76\u4fdd\u5b58\u3002\u53ef\u4ee5\u5728\u5faa\u73af\u4e2d\u52a0\u5165\u6761\u4ef6\u5224\u65ad\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data_list = [&quot;data1&quot;, &quot;data2&quot;, &quot;data3&quot;]<\/p>\n<p>save_path = &quot;output\/&quot;<\/p>\n<p>for i, data in enumerate(data_list):<\/p>\n<p>    if &quot;1&quot; in data:  # \u6761\u4ef6\u5224\u65ad<\/p>\n<p>        file_name = save_path + f&quot;file_{i}.txt&quot;<\/p>\n<p>        with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>            file.write(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u53ea\u6709\u5305\u542b\u201c1\u201d\u7684\u6570\u636e\u624d\u4f1a\u88ab\u4fdd\u5b58\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u5229\u7528os\u6a21\u5757\u521b\u5efa\u76ee\u5f55<\/p>\n<\/p>\n<p><p>\u5f53\u6211\u4eec\u9700\u8981\u5728\u591a\u4e2a\u76ee\u5f55\u4e2d\u4fdd\u5b58\u6587\u4ef6\u65f6\uff0cos\u6a21\u5757\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u521b\u5efa\u76ee\u5f55\u7ed3\u6784\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u4fdd\u5b58\u6587\u4ef6\u4e4b\u524d\uff0c\u76ee\u5f55\u5df2\u7ecf\u5b58\u5728\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5\u5e76\u521b\u5efa\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528os\u6a21\u5757\u68c0\u67e5\u76ee\u5f55\u662f\u5426\u5b58\u5728\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\u76ee\u5f55\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>save_path = &quot;output\/&quot;<\/p>\n<p>if not os.path.exists(save_path):<\/p>\n<p>    os.makedirs(save_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>os.makedirs<\/code>\u51fd\u6570\u4f1a\u9012\u5f52\u5730\u521b\u5efa\u6240\u6709\u9700\u8981\u7684\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ed3\u5408\u76ee\u5f55\u7ed3\u6784\u8fdb\u884c\u6279\u91cf\u4fdd\u5b58<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u6839\u636e\u67d0\u79cd\u89c4\u5219\u521b\u5efa\u4e0d\u540c\u7684\u76ee\u5f55\uff0c\u5e76\u5728\u5176\u4e2d\u4fdd\u5b58\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>data_dict = {&quot;dir1&quot;: [&quot;data1&quot;, &quot;data2&quot;], &quot;dir2&quot;: [&quot;data3&quot;, &quot;data4&quot;]}<\/p>\n<p>base_path = &quot;output\/&quot;<\/p>\n<p>for dir_name, data_list in data_dict.items():<\/p>\n<p>    dir_path = os.path.join(base_path, dir_name)<\/p>\n<p>    if not os.path.exists(dir_path):<\/p>\n<p>        os.makedirs(dir_path)<\/p>\n<p>    for i, data in enumerate(data_list):<\/p>\n<p>        file_name = os.path.join(dir_path, f&quot;file_{i}.txt&quot;)<\/p>\n<p>        with open(file_name, &#39;w&#39;) as file:<\/p>\n<p>            file.write(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u6839\u636e\u5b57\u5178\u7684\u952e\u521b\u5efa\u76ee\u5f55\uff0c\u5e76\u5728\u76f8\u5e94\u76ee\u5f55\u4e0b\u4fdd\u5b58\u5bf9\u5e94\u6570\u636e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u5229\u7528pandas\u5e93\u4fdd\u5b58\u6587\u4ef6<\/p>\n<\/p>\n<p><p>pandas\u5e93\u662fPython\u4e2d\u975e\u5e38\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u5e93\uff0c\u5c24\u5176\u5728\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u65f6\uff0c\u80fd\u591f\u65b9\u4fbf\u5730\u5c06\u6570\u636e\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\u7684\u6587\u4ef6\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4fdd\u5b58\u4e3aCSV\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>pandas\u63d0\u4f9b\u4e86to_csv\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06DataFrame\u4fdd\u5b58\u4e3aCSV\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>data = {<\/p>\n<p>    &quot;Column1&quot;: [1, 2, 3],<\/p>\n<p>    &quot;Column2&quot;: [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>df.to_csv(&quot;output\/data.csv&quot;, index=False)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\u7684<code>index=False<\/code>\u53c2\u6570\u7528\u4e8e\u907f\u514d\u5c06\u884c\u7d22\u5f15\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u4e3aExcel\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>pandas\u540c\u6837\u652f\u6301\u5c06DataFrame\u4fdd\u5b58\u4e3aExcel\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df.to_excel(&quot;output\/data.xlsx&quot;, index=False)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fdd\u5b58\u4e3aExcel\u683c\u5f0f\u9700\u8981\u5b89\u88c5openpyxl\u6216xlsxwriter\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6279\u91cf\u4fdd\u5b58\u591a\u4e2aDataFrame<\/strong><\/p>\n<\/p>\n<p><p>pandas\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6279\u91cf\u4fdd\u5b58\u591a\u4e2aDataFrame\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>dfs = {<\/p>\n<p>    &quot;sheet1&quot;: pd.DataFrame({&quot;A&quot;: [1, 2, 3]}),<\/p>\n<p>    &quot;sheet2&quot;: pd.DataFrame({&quot;B&quot;: [4, 5, 6]})<\/p>\n<p>}<\/p>\n<p>with pd.ExcelWriter(&quot;output\/multi_sheets.xlsx&quot;) as writer:<\/p>\n<p>    for sheet_name, df in dfs.items():<\/p>\n<p>        df.to_excel(writer, sheet_name=sheet_name)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>ExcelWriter<\/code>\u5bf9\u8c61\u5141\u8bb8\u6211\u4eec\u5728\u4e00\u4e2aExcel\u6587\u4ef6\u4e2d\u521b\u5efa\u591a\u4e2a\u5de5\u4f5c\u8868\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5176\u4ed6\u5916\u90e8\u5e93\u7684\u4f7f\u7528<\/p>\n<\/p>\n<p><p>\u9664\u4e86os\u548cpandas\uff0cPython\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7684\u5e93\u53ef\u4ee5\u7528\u4e8e\u6587\u4ef6\u64cd\u4f5c\u3002\u4f8b\u5982\uff0cshutil\u53ef\u4ee5\u7528\u4e8e\u9ad8\u7ea7\u7684\u6587\u4ef6\u64cd\u4f5c\uff0cPathlib\u63d0\u4f9b\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u6587\u4ef6\u8def\u5f84\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Pathlib\u8fdb\u884c\u8def\u5f84\u64cd\u4f5c<\/strong><\/p>\n<\/p>\n<p><p>Pathlib\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u76f4\u89c2\u7684\u8def\u5f84\u64cd\u4f5c\u65b9\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>base_path = Path(&quot;output&quot;)<\/p>\n<p>base_path.mkdir(parents=True, exist_ok=True)<\/p>\n<p>file_path = base_path \/ &quot;example.txt&quot;<\/p>\n<p>file_path.write_text(&quot;Hello World&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>Path<\/code>\u5bf9\u8c61\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u8def\u5f84\u64cd\u4f5c\u65b9\u6cd5\uff0c\u4f7f\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u53ef\u8bfb\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528shutil\u8fdb\u884c\u6587\u4ef6\u590d\u5236<\/strong><\/p>\n<\/p>\n<p><p>shutil\u5e93\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\uff0c\u5982\u590d\u5236\u3001\u79fb\u52a8\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import shutil<\/p>\n<p>shutil.copy(&quot;output\/example.txt&quot;, &quot;backup\/example.txt&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>shutil.copy<\/code>\u65b9\u6cd5\u7528\u4e8e\u590d\u5236\u6587\u4ef6\uff0c\u8fd9\u5728\u5907\u4efd\u6587\u4ef6\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5de5\u5177\u548c\u5e93\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b9e\u73b0\u6279\u91cf\u6587\u4ef6\u4fdd\u5b58\u3002\u4ece\u7b80\u5355\u7684\u5faa\u73af\u4fdd\u5b58\uff0c\u5230\u4f7f\u7528os\u6a21\u5757\u521b\u5efa\u76ee\u5f55\uff0c\u518d\u5230\u5229\u7528pandas\u5904\u7406\u6570\u636e\u6587\u4ef6\uff0cPython\u90fd\u80fd\u9ad8\u6548\u5730\u5b8c\u6210\u4efb\u52a1\u3002\u5728\u9009\u62e9\u5177\u4f53\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u6839\u636e\u6570\u636e\u7c7b\u578b\u3001\u6587\u4ef6\u683c\u5f0f\u548c\u64cd\u4f5c\u590d\u6742\u5ea6\u8fdb\u884c\u9009\u62e9\u3002\u65e0\u8bba\u662f\u4f7f\u7528\u5185\u7f6e\u5e93\u8fd8\u662f\u5916\u90e8\u5e93\uff0cPython\u90fd\u80fd\u4e3a\u6587\u4ef6\u64cd\u4f5c\u63d0\u4f9b\u5f3a\u5927\u7684\u652f\u6301\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u6587\u4ef6\u5904\u7406\u7684\u6548\u7387\u548c\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u6279\u91cf\u4fdd\u5b58\u591a\u4e2a\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u7ed3\u5408\u6587\u4ef6\u64cd\u4f5c\u6765\u6279\u91cf\u4fdd\u5b58\u591a\u4e2a\u6587\u4ef6\u3002\u901a\u8fc7\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u5728\u6307\u5b9a\u7684\u8def\u5f84\u4e0b\u521b\u5efa\u548c\u5199\u5165\u6587\u4ef6\u5185\u5bb9\u3002\u4f7f\u7528\u5217\u8868\u6216\u8005\u5b57\u5178\u6765\u5b58\u50a8\u6587\u4ef6\u540d\u548c\u5185\u5bb9\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5b9e\u73b0\u6279\u91cf\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a<code>for<\/code>\u5faa\u73af\u8fed\u4ee3\u6587\u4ef6\u540d\u5217\u8868\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u6587\u4ef6\u5199\u5165\u76f8\u5e94\u7684\u5185\u5bb9\u3002<\/p>\n<p><strong>\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\u65f6\u5982\u4f55\u5904\u7406\u6587\u4ef6\u8def\u5f84\uff1f<\/strong><br \/>\u5904\u7406\u6587\u4ef6\u8def\u5f84\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os<\/code>\u6a21\u5757\u4e2d\u7684<code>os.path.join()<\/code>\u51fd\u6570\u6765\u786e\u4fdd\u751f\u6210\u7684\u8def\u5f84\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002\u901a\u8fc7\u5c06\u76ee\u5f55\u8def\u5f84\u548c\u6587\u4ef6\u540d\u7ec4\u5408\uff0c\u53ef\u4ee5\u907f\u514d\u56e0\u624b\u52a8\u62fc\u63a5\u8def\u5f84\u800c\u5bfc\u81f4\u7684\u9519\u8bef\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u5728\u4fdd\u5b58\u6587\u4ef6\u4e4b\u524d\u68c0\u67e5\u76ee\u6807\u76ee\u5f55\u662f\u5426\u5b58\u5728\uff0c\u5fc5\u8981\u65f6\u53ef\u4ee5\u4f7f\u7528<code>os.makedirs()<\/code>\u521b\u5efa\u76ee\u5f55\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\u65f6\u4e0d\u4f1a\u8986\u76d6\u5df2\u6709\u6587\u4ef6\uff1f<\/strong><br \/>\u4e3a\u4e86\u907f\u514d\u8986\u76d6\u5df2\u6709\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u4fdd\u5b58\u6587\u4ef6\u4e4b\u524d\u68c0\u67e5\u8be5\u6587\u4ef6\u662f\u5426\u5df2\u5b58\u5728\u3002\u4f7f\u7528<code>os.path.exists()<\/code>\u51fd\u6570\u6765\u68c0\u6d4b\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5982\u679c\u6587\u4ef6\u5df2\u5b58\u5728\uff0c\u53ef\u4ee5\u9009\u62e9\u4fee\u6539\u6587\u4ef6\u540d\uff08\u4f8b\u5982\uff0c\u6dfb\u52a0\u540e\u7f00\u6216\u65f6\u95f4\u6233\uff09\u4ee5\u786e\u4fdd\u65b0\u6587\u4ef6\u4e0d\u4f1a\u88ab\u8986\u76d6\u3002\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5b9e\u73b0\u4e00\u4e2a\u6587\u4ef6\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u81ea\u52a8\u4fdd\u5b58\u4e0d\u540c\u7248\u672c\u7684\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u6279\u91cf\u4fdd\u5b58\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5faa\u73af\u3001\u5229\u7528Python\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u5e93\u3001\u501f\u52a9\u5916\u90e8\u5e93\u5982pand [&hellip;]","protected":false},"author":3,"featured_media":1012434,"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\/1012424"}],"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=1012424"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1012424\/revisions"}],"predecessor-version":[{"id":1012436,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1012424\/revisions\/1012436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1012434"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1012424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1012424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1012424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}