处理json


import json

1. 读取json文件

import json
with open("filepath","rb+") as jsonfile:
     json.loads(jsonfile.read())

2. 生成json文件

import json
with open("file_name", "w") as f:
    json.dump(json_data, f)

相关