import json #序列化,dict->json d = {'k':'v'} print(d) j = json.dumps(d) print(j) #反序列化,json->dict print(json.loads(j))