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)
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)