读取JSON文件可以用JSON库,示例代码:
#coding:utf-8
import json
with open("msg.json") as jsonfile:
json_data = json.load(jsonfile)
for key in json_data:
val = json_data[key]
print key + '\t' + val
读取JSON文件可以用JSON库,示例代码:
#coding:utf-8
import json
with open("msg.json") as jsonfile:
json_data = json.load(jsonfile)
for key in json_data:
val = json_data[key]
print key + '\t' + val
转载于:https://my.oschina.net/artwl/blog/694363