Open jzztf opened 6 years ago
import json python_value = {'zhanghua': 78,'lili':89,'xiaohong':False} json_data = json.dumps(python_value) json_data # ==> '{"zhanghua": 78, "lili": 89, "xiaohong": false}'
py_value = json.loads(json_data) py_value # ==> {'lili': 89, 'xiaohong': False, 'zhanghua': 78}
python模块json
python的json模块
dumps()函数写入json
loads()函数读取json