接口风格类似 pickle。 编码 1import json2 3data = data = {"answer": 42, "is_answer": True}4json.dumps(data) # 返回 '{"answer": 42, "is_answer": true}' 解码 1data = '{"answer": 42, "is_answer": true}'2json.loads(data) # 返回 {'answer': 42, "is_answer": True} 参考 json