Use the JSON module primarily to import the import JSON directly.
A small example is as follows:
#coding =utf-8
import json
info={}
info["code"]=1
info["id"]=1900
info["name"]= ' John '
info ["Sex"]= ' man '
List=[info,info,info]
data={}
data["code"]=1
data["id"]=1900
data["name"]= " John '
data["sex"]= ' man '
data["info"]=info data[
"Data"]=list jsonstr
= json.dumps (data)
Key code: JSONSTR = json.dumps (data)
<span style= "font-family:arial; Background-color: #ffffff "> Execution output is as follows:</span>
jsonstr: {" info ": {" code ": 1," Sex ":" \u7537 "," id ": 1900," Name ":" \u5f20\u4e09 "}," code ": 1," name ":" \u5f20\u4e09 "," Sex ":" \u7537 "," data ": [{" Code ": 1," Sex ":" \u7537 "," id ": 19 "Name": "\u5f20\u4e09"}, {"Code": 1, "Sex": "\u7537", "id": 1900, "name": "\u5f20\u4e09"}, {"Code": 1, "Sex": "\u7537" , "id": 1900, "name": "\u5f20\u4e09"}], "id": 1900}
The above is a small series of Python in the JSON format data output of the simple implementation of the full content, I hope that we support cloud-Habitat Community ~