json 读取,创建

import json
# json.loads() 是将字符串转换为字典
# json.dumps() 是
# json.load()
# json.dump()

# # 写入 JSON 数据
# with open('data.json', 'w') as f:
# json.dump(data, f)
#
# # 读取数据
# with open('data.json', 'r') as f:
# data = json.load(f)
posted @ 2022-08-21 21:01  记录——去繁就简  阅读(11)  评论(0)    收藏  举报