JSON解析的例子
功能:把json字符串转成python语言的dict
#coding: utf-8
import json
json_str = """
{
"id" : 90,
"name" : "python",
"url" : "http://www.baidu.com",
"title" : "Python",
"title_alternative" : "Python",
"topics" : 7646,
"stars" : 4862,
"header" : "Python 语言",
"footer" : null,
"created" : 1278683336,
"avatar_mini" : "//v2ex.assets.uxengine.net/90_mini.png?m=1504",
}
"""
res = json.loads(json_str)
print(res['id']) # 90
print(res['name']) # python
print(res['url']) # http://www.baidu.com