json读写以及格式化
import json
with open(filedir, 'r') as load_f: load_dict = json.load(load_f) with open(filedir, "w") as f: json.dump(load_dict, f, indent=4)
#indent:格式化 print("加载入文件完成...")
import json
with open(filedir, 'r') as load_f: load_dict = json.load(load_f) with open(filedir, "w") as f: json.dump(load_dict, f, indent=4)
#indent:格式化 print("加载入文件完成...")