{"id":1008925,"date":"2024-12-27T11:07:09","date_gmt":"2024-12-27T03:07:09","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1008925.html"},"modified":"2024-12-27T11:07:12","modified_gmt":"2024-12-27T03:07:12","slug":"%e6%96%87%e4%bb%b6%e5%a6%82%e4%bd%95%e8%bd%ac%e5%ad%97%e5%85%b8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1008925.html","title":{"rendered":"\u6587\u4ef6\u5982\u4f55\u8f6c\u5b57\u5178python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25084028\/53b99aad-40ee-41ca-ad75-87cf9ddadecf.webp\" alt=\"\u6587\u4ef6\u5982\u4f55\u8f6c\u5b57\u5178python\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c<strong>\u5c06\u6587\u4ef6\u8f6c\u6362\u4e3a\u5b57\u5178<\/strong>\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u6587\u4ef6\u7684\u683c\u5f0f\u3002\u5e38\u89c1\u7684\u6587\u4ef6\u683c\u5f0f\u6709JSON\u3001CSV\u3001INI\u7b49\uff0c\u6bcf\u79cd\u683c\u5f0f\u90fd\u6709\u76f8\u5e94\u7684\u5e93\u548c\u65b9\u6cd5\u6765\u8fdb\u884c\u89e3\u6790\u548c\u8f6c\u6362\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u5e38\u89c1\u7684\u6587\u4ef6\u8f6c\u6362\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>JSON\u6587\u4ef6\u8f6c\u6362\uff1a\u4f7f\u7528<code>json<\/code>\u5e93\u52a0\u8f7dJSON\u6587\u4ef6\u5e76\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/li>\n<li>CSV\u6587\u4ef6\u8f6c\u6362\uff1a\u4f7f\u7528<code>csv<\/code>\u5e93\u8bfb\u53d6CSV\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/li>\n<li>INI\u6587\u4ef6\u8f6c\u6362\uff1a\u4f7f\u7528<code>configparser<\/code>\u5e93\u8bfb\u53d6INI\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u5b9e\u73b0\u6587\u4ef6\u5230\u5b57\u5178\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001JSON\u6587\u4ef6\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>JSON\uff08JavaScript Object Notation\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f\u3002\u5b83\u6613\u4e8e\u4eba\u9605\u8bfb\u548c\u7f16\u5199\uff0c\u540c\u65f6\u4e5f\u6613\u4e8e\u673a\u5668\u89e3\u6790\u548c\u751f\u6210\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>json<\/code>\u5e93\u6765\u5904\u7406JSON\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528<code>json<\/code>\u5e93\u8bfb\u53d6JSON\u6587\u4ef6<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import json<\/p>\n<p>def json_to_dict(file_path):<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        data = json.load(file)<\/p>\n<p>    return data<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>file_path = &#39;data.json&#39;<\/p>\n<p>data_dict = json_to_dict(file_path)<\/p>\n<p>print(data_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c<code>json.load()<\/code>\u51fd\u6570\u7528\u4e8e\u89e3\u6790JSON\u6587\u4ef6\u7684\u5185\u5bb9\u5e76\u5c06\u5176\u8f6c\u6362\u4e3aPython\u5b57\u5178\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cJSON\u6587\u4ef6\u7684\u5185\u5bb9\u5fc5\u987b\u662f\u6709\u6548\u7684JSON\u683c\u5f0f\uff0c\u5426\u5219\u89e3\u6790\u4f1a\u5931\u8d25\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001CSV\u6587\u4ef6\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>CSV\uff08Comma-Separated Values\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u7535\u5b50\u8868\u683c\u6587\u4ef6\u683c\u5f0f\uff0c\u901a\u5e38\u7528\u4e8e\u5728\u4e0d\u540c\u7a0b\u5e8f\u4e4b\u95f4\u4ea4\u6362\u8868\u683c\u6570\u636e\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>csv<\/code>\u5e93\u6765\u8bfb\u53d6CSV\u6587\u4ef6\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528<code>csv.DictReader<\/code>\u8bfb\u53d6CSV\u6587\u4ef6<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import csv<\/p>\n<p>def csv_to_dict(file_path):<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        csv_reader = csv.DictReader(file)<\/p>\n<p>        data_list = [row for row in csv_reader]<\/p>\n<p>    return data_list<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>file_path = &#39;data.csv&#39;<\/p>\n<p>data_list = csv_to_dict(file_path)<\/p>\n<p>for data_dict in data_list:<\/p>\n<p>    print(data_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c<code>csv.DictReader<\/code>\u5c06CSV\u6587\u4ef6\u7684\u6bcf\u4e00\u884c\u8f6c\u6362\u4e3a\u4e00\u4e2a\u5b57\u5178\uff0c\u5176\u4e2dCSV\u7684\u7b2c\u4e00\u884c\u4f5c\u4e3a\u5b57\u5178\u7684\u952e\u3002<code>csv.DictReader<\/code>\u5728\u5904\u7406\u5927\u6587\u4ef6\u65f6\u975e\u5e38\u6709\u7528\uff0c\u56e0\u4e3a\u5b83\u9010\u884c\u8bfb\u53d6\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6574\u4e2a\u6587\u4ef6\u8bfb\u5165\u5185\u5b58\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001INI\u6587\u4ef6\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>INI\u6587\u4ef6\u662f\u4e00\u79cd\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\uff0c\u901a\u5e38\u7528\u4e8e\u5b58\u50a8\u5e94\u7528\u7a0b\u5e8f\u7684\u914d\u7f6e\u6570\u636e\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>configparser<\/code>\u5e93\u6765\u8bfb\u53d6INI\u6587\u4ef6\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528<code>configparser<\/code>\u8bfb\u53d6INI\u6587\u4ef6<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import configparser<\/p>\n<p>def ini_to_dict(file_path):<\/p>\n<p>    config = configparser.ConfigParser()<\/p>\n<p>    config.read(file_path, encoding=&#39;utf-8&#39;)<\/p>\n<p>    data_dict = {section: dict(config.items(section)) for section in config.sections()}<\/p>\n<p>    return data_dict<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>file_path = &#39;config.ini&#39;<\/p>\n<p>data_dict = ini_to_dict(file_path)<\/p>\n<p>print(data_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c<code>configparser.ConfigParser()<\/code>\u7528\u4e8e\u89e3\u6790INI\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u5185\u5bb9\u7ec4\u7ec7\u4e3a\u4e00\u4e2a\u5b57\u5178\uff0c\u5b57\u5178\u7684\u952e\u4e3aINI\u6587\u4ef6\u4e2d\u7684\u8282\u540d\uff0c\u503c\u4e3a\u8be5\u8282\u4e0b\u7684\u952e\u503c\u5bf9\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001XML\u6587\u4ef6\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>\u867d\u7136XML\u6587\u4ef6\u5e76\u4e0d\u662f\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u5178\u7684\u5e38\u89c1\u683c\u5f0f\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u89e3\u6790XML\u6587\u4ef6\u5e76\u5c06\u5176\u5185\u5bb9\u8f6c\u6362\u4e3a\u5b57\u5178\u683c\u5f0f\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>xml.etree.ElementTree<\/code>\u5e93\u6765\u89e3\u6790XML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528<code>xml.etree.ElementTree<\/code>\u8bfb\u53d6XML\u6587\u4ef6<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import xml.etree.ElementTree as ET<\/p>\n<p>def xml_to_dict(file_path):<\/p>\n<p>    tree = ET.parse(file_path)<\/p>\n<p>    root = tree.getroot()<\/p>\n<p>    def elem_to_dict(elem):<\/p>\n<p>        d = {elem.tag: {} if elem.attrib else None}<\/p>\n<p>        children = list(elem)<\/p>\n<p>        if children:<\/p>\n<p>            dd = dict()<\/p>\n<p>            for dc in map(elem_to_dict, children):<\/p>\n<p>                for k, v in dc.items():<\/p>\n<p>                    dd[k] = v<\/p>\n<p>            d = {elem.tag: dd}<\/p>\n<p>        if elem.attrib:<\/p>\n<p>            d[elem.tag].update((&#39;@&#39; + k, v) for k, v in elem.attrib.items())<\/p>\n<p>        if elem.text:<\/p>\n<p>            text = elem.text.strip()<\/p>\n<p>            if children or elem.attrib:<\/p>\n<p>                if text:<\/p>\n<p>                    d[elem.tag][&#39;#text&#39;] = text<\/p>\n<p>            else:<\/p>\n<p>                d[elem.tag] = text<\/p>\n<p>        return d<\/p>\n<p>    return elem_to_dict(root)<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>file_path = &#39;data.xml&#39;<\/p>\n<p>data_dict = xml_to_dict(file_path)<\/p>\n<p>print(data_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c<code>xml.etree.ElementTree<\/code>\u7528\u4e8e\u89e3\u6790XML\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7\u9012\u5f52\u51fd\u6570\u5c06XML\u7684\u5c42\u6b21\u7ed3\u6784\u8f6c\u6362\u4e3a\u5b57\u5178\u683c\u5f0f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cXML\u6587\u4ef6\u7684\u7ed3\u6784\u53ef\u80fd\u6bd4\u8f83\u590d\u6742\uff0c\u56e0\u6b64\u8f6c\u6362\u540e\u7684\u5b57\u5178\u53ef\u80fd\u4f1a\u6709\u8f83\u591a\u7684\u5d4c\u5957\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001YAML\u6587\u4ef6\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>YAML\uff08YAML <a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n&#39;t Markup Language\uff09\u662f\u4e00\u79cd\u4eba\u7c7b\u53ef\u8bfb\u7684\u6570\u636e\u5e8f\u5217\u5316\u6807\u51c6\uff0c\u5e38\u7528\u4e8e\u914d\u7f6e\u6587\u4ef6\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>PyYAML<\/code>\u5e93\u6765\u8bfb\u53d6YAML\u6587\u4ef6\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528<code>PyYAML<\/code>\u8bfb\u53d6YAML\u6587\u4ef6<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import yaml<\/p>\n<p>def yaml_to_dict(file_path):<\/p>\n<p>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        data = yaml.<a href=\"https:\/\/docs.pingcode.com\/agile\/agile-at-scale\/what-is-safe\" target=\"_blank\">SAFe<\/a>_load(file)<\/p>\n<p>    return data<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>file_path = &#39;data.yaml&#39;<\/p>\n<p>data_dict = yaml_to_dict(file_path)<\/p>\n<p>print(data_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c<code>yaml.safe_load()<\/code>\u51fd\u6570\u7528\u4e8e\u89e3\u6790YAML\u6587\u4ef6\u7684\u5185\u5bb9\u5e76\u5c06\u5176\u8f6c\u6362\u4e3aPython\u5b57\u5178\u3002\u4e0eJSON\u7c7b\u4f3c\uff0cYAML\u6587\u4ef6\u7684\u5185\u5bb9\u5fc5\u987b\u662f\u6709\u6548\u7684YAML\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u6587\u4ef6\u8f6c\u6362\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u6587\u4ef6\u8f6c\u6362\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u6587\u4ef6\u7f16\u7801<\/strong>\uff1a\u786e\u4fdd\u4ee5\u6b63\u786e\u7684\u7f16\u7801\u6253\u5f00\u6587\u4ef6\uff0c\u901a\u5e38\u4f7f\u7528<code>utf-8<\/code>\u3002<\/li>\n<li><strong>\u6587\u4ef6\u683c\u5f0f<\/strong>\uff1a\u786e\u4fdd\u6587\u4ef6\u7684\u683c\u5f0f\u662f\u6709\u6548\u7684\u5e76\u7b26\u5408\u6807\u51c6\uff0c\u5426\u5219\u89e3\u6790\u4f1a\u5931\u8d25\u3002<\/li>\n<li><strong>\u9519\u8bef\u5904\u7406<\/strong>\uff1a\u5728\u8bfb\u53d6\u6587\u4ef6\u65f6\uff0c\u9700\u8981\u8003\u8651\u53ef\u80fd\u7684\u5f02\u5e38\u60c5\u51b5\uff0c\u5982\u6587\u4ef6\u4e0d\u5b58\u5728\u3001\u683c\u5f0f\u9519\u8bef\u7b49\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try-except<\/code>\u5757\u8fdb\u884c\u5904\u7406\u3002<\/li>\n<\/ul>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5c06\u6587\u4ef6\u8f6c\u6362\u4e3a\u5b57\u5178\u5728\u6570\u636e\u5904\u7406\u548c\u914d\u7f6e\u7ba1\u7406\u4e2d\u975e\u5e38\u5e38\u89c1\u3002Python\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e93\u6765\u5904\u7406\u4e0d\u540c\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u5982JSON\u3001CSV\u3001INI\u3001XML\u548cYAML\u7b49\u3002\u6839\u636e\u6587\u4ef6\u7684\u683c\u5f0f\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u8fdb\u884c\u89e3\u6790\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u548c\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u548c\u6587\u4ef6\u683c\u5f0f\u9009\u62e9\u5408\u9002\u7684\u89e3\u6790\u65b9\u6cd5\uff0c\u5e76\u6ce8\u610f\u5904\u7406\u53ef\u80fd\u7684\u5f02\u5e38\u60c5\u51b5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u8bfb\u53d6\u5230Python\u5b57\u5178\u4e2d\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>open<\/code>\u51fd\u6570\u8bfb\u53d6\u6587\u672c\u6587\u4ef6\uff0c\u7136\u540e\u5229\u7528<code>split<\/code>\u65b9\u6cd5\u5c06\u6bcf\u4e00\u884c\u5206\u5272\u6210\u952e\u503c\u5bf9\u3002\u63a5\u7740\uff0c\u901a\u8fc7\u5b57\u5178\u7684\u6784\u9020\u65b9\u6cd5\u5c06\u8fd9\u4e9b\u952e\u503c\u5bf9\u5b58\u50a8\u5230\u5b57\u5178\u4e2d\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u6587\u4ef6\u5185\u5bb9\u4e3a\u201ckey1:value1\\nkey2:value2\u201d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4ee3\u7801\u5b9e\u73b0\uff1a  <\/p>\n<pre><code class=\"language-python\">dictionary = {}\nwith open(&#39;file.txt&#39;, &#39;r&#39;) as file:\n    for line in file:\n        key, value = line.strip().split(&#39;:&#39;)\n        dictionary[key] = value\n<\/code><\/pre>\n<p><strong>\u5728Python\u4e2d\uff0c\u5982\u4f55\u5904\u7406CSV\u6587\u4ef6\u5e76\u8f6c\u5316\u4e3a\u5b57\u5178\u683c\u5f0f\uff1f<\/strong><br \/>\u5bf9\u4e8eCSV\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>csv<\/code>\u6a21\u5757\u6765\u7b80\u5316\u64cd\u4f5c\u3002\u53ef\u4ee5\u901a\u8fc7<code>csv.DictReader<\/code>\u76f4\u63a5\u5c06\u6bcf\u4e00\u884c\u8f6c\u6362\u4e3a\u5b57\u5178\uff0c\u5176\u4e2d\u5b57\u6bb5\u540d\u4f5c\u4e3a\u952e\uff0c\u884c\u6570\u636e\u4f5c\u4e3a\u503c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">import csv\n\nwith open(&#39;file.csv&#39;, mode=&#39;r&#39;) as file:\n    reader = csv.DictReader(file)\n    dictionary_list = [row for row in reader]\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5c06JSON\u6587\u4ef6\u8f6c\u6362\u4e3aPython\u5b57\u5178\uff1f<\/strong><br \/>\u5904\u7406JSON\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u5229\u7528<code>json<\/code>\u6a21\u5757\u7684<code>load<\/code>\u65b9\u6cd5\u5c06\u6587\u4ef6\u5185\u5bb9\u76f4\u63a5\u8f6c\u6362\u4e3a\u5b57\u5178\u3002\u8fd9\u6837\u53ef\u4ee5\u8f7b\u677e\u83b7\u53d6\u5d4c\u5957\u7ed3\u6784\u7684\u6570\u636e\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">import json\n\nwith open(&#39;file.json&#39;, &#39;r&#39;) as file:\n    dictionary = json.load(file)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u4e0d\u540c\u683c\u5f0f\u7684\u6587\u4ef6\u5185\u5bb9\u8f6c\u5316\u4e3aPython\u5b57\u5178\uff0c\u8fdb\u800c\u8fdb\u884c\u6570\u636e\u5904\u7406\u4e0e\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5c06\u6587\u4ef6\u8f6c\u6362\u4e3a\u5b57\u5178\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u6587\u4ef6\u7684\u683c\u5f0f\u3002\u5e38\u89c1\u7684\u6587\u4ef6\u683c\u5f0f\u6709JSON\u3001CSV [&hellip;]","protected":false},"author":3,"featured_media":1008942,"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\/1008925"}],"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=1008925"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1008925\/revisions"}],"predecessor-version":[{"id":1008945,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1008925\/revisions\/1008945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1008942"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1008925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1008925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1008925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}