多个字典合成jsonall_dict为包括所有字典的listfor each_dict in all_dict: with open('train1.json', 'a', encoding='utf-8') as f: json.dump(each_dict, f) f.write('\n')