python解析json
json文件 import json jsonDict = json.loads(open('json文件路径',mode='rb').read()) jsonDict为字典格式,使用json解析print jsonDumped = json.dumps(jsonDict, ensure_ascii=False, indent=4 ,separators=(',',':')) 打印便是解析之后的json格式 print(jsonDumped) 保存文件同样是解析之后的。