# coding:utf-8
import json
data = {"spam": "foo", "parrot": 42}
in_json = json.dumps(data) # Encode the data
print(in_json)
out = json.loads(in_json) # Decode into a Python object
print(out)
# coding:utf-8
import json
data = {"spam": "foo", "parrot": 42}
in_json = json.dumps(data) # Encode the data
print(in_json)
out = json.loads(in_json) # Decode into a Python object
print(out)
本文标题:将返回的数据以json串的形式返回去
本文链接:https://www.haomeiwen.com/subject/urghzftx.html
网友评论