json sequence of python

# from urllib import request 
#
# f=request.urlopen("http://123.178.101.29:81/xs_main.aspx?xh=201512102028")
#
# result=str(f.read(),encoding='gb2312' )
# print(result)
#json.loads is used to convert strings in the form of dictionaries, lists, and tuples into corresponding dictionaries, lists, and tuples #Use
json to turn strings into dictionaries
# s='{" name":"guo","age":18}'
# import json
# result=json.loads(s)
# print(result,type(result)) #change

the string to a list
# l='[11, 22,33,44]'
# import json
# result=json.loads(l)
# print(result,type(result))

#json.loads() is used to convert strings to python basic data types
#json.dumps () function is to convert the basic type of python to a string
# lists=["alex","guo","xiaolu"]
# import json
# s=json.dumps(lists)
# print(s)

#json=string (content is in the form of list, tuple, dictionary)
#http request corresponding content string

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325113462&siteId=291194637