json格式化
http://tool.oschina.net/codeformat/json/
python json美化输出
json_dicts = json.dumps(data,ensure_ascii=False, indent=2)print(json_dicts)print(json_dicts.replace('"',"'").replace("\\'",'"'))or>>> import json>>> print json.dumps({'a': 'Runoob', 'b': 7}, sort_keys=True, indent=4, separators=(',', ': ')){"a": "Runoob","b": 7}
