首页 > 学院 > 开发设计 > 正文

python学习笔记十六:读取JSON文件

2019-11-14 17:22:55
字体:
来源:转载
供稿:网友

读取JSON文件可以用JSON库,示例代码:

#coding:utf-8import jsonwith open("msg.json") as jsonfile:    json_data = json.load(jsonfile)    for key in json_data:        val = json_data[key]        PRint key + '/t' + val

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表