处理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)
posted @ 2018-10-12 14:02  eudaemonia  阅读(110)  评论(0编辑  收藏  举报