记录一个方法,pyhton 通过 json 文件,在同级目录下生成对应格式的小文本。 import json def generate_files_from_json(json_file): with open(json_file, 'r', encoding='utf-8') as f: data = json.load(f) for item in data: for key, value in item.items(): if isinstance(value, list): for sub_item in value: for sub_key, sub_value in sub_item.items(): if isinstance(sub_value, dict) and 'list' in sub_value: for sub_sub_item in