import json with open('head.json', 'r') as f: j = json.load(f) chenghao = j['1'] head = j['2'] headframe = j['3'] with open('chenghao.json', 'w', encoding='utf8') as f: json.dump(chenghao, f) with open('head.json', 'w', encoding='utf8') as f: json.dump(head, f) with open('headframe.json', 'w', encoding='utf8') as f: json.dump(headframe, f)