python3 读写json文件

code

import json

new_dict={"func_name":"https://www.cnblogs.com/bigberg/p/6430095.html"}
with open("record.json","w") as f:
    json.dump(new_dict,f)

with open("record.json",'r') as load_f:
    load_dict = json.load(load_f)
    print(load_dict)

 

 

 

 

 

 

 

 

 

posted @ 2020-11-27 19:12  anobscureretreat  阅读(182)  评论(0编辑  收藏  举报