import json with open('test_data.json', 'r', encoding="utf-8") as file: str = file.read() data = json.loads(str) json_str = json.dumps(data, indent=4, ensure_ascii=False) # ensure_ascii 设置为 False,默认为true,转义 with open('./test_data1.json', 'w', encoding="utf-8") as json_file: json_file.write(json_str)