读写json文件

def  read_json(path):
    """return dict"""
    with open(path,'r+')as f:
          return json.load(f)
def write_json(path,data):
    with open(path,"w+")as f:
        json.dump(data,f,indent=2)

  .

posted @ 2019-11-15 14:45  不带R的墨菲特  阅读(157)  评论(0)    收藏  举报