with open(path, 'w') as fw:
# 将字典转化为字符串
# json_str = json.dumps(data)
# fw.write(json_str)
# 上面两句等同于下面这句
json.dump(result,fw)
with open(path,'r') as f:
a=json.load(f)
with open(path, 'w') as fw:
# 将字典转化为字符串
# json_str = json.dumps(data)
# fw.write(json_str)
# 上面两句等同于下面这句
json.dump(result,fw)
with open(path,'r') as f:
a=json.load(f)