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("加载入文件完成...")

 

posted @ 2021-10-08 13:45  九里九里  阅读(93)  评论(0编辑  收藏  举报