import json d = {"name":"英雄无敌7"} res = json.dumps(d) # 打印res 会显示 {"name": "\u82f1\u96c4\u65e0\u654c7"}.原因是在默认情况下,调用json.dumps会对中文采用ASCII进行编码,故显示异常. # 想要显示中文,需要更改默认的参数,如: res = json.dumps(d,ensure_ascii=False) # prin
Pickle-------python对象序列化 本文主要阐述以下几点: 1.pickle模块简介 2.pickle模块提供的方法 3.注意事项 4.实例解析 1.pickle模块简介 The pickle module implements a fundamental, but powerful algorithm for serializing(序列化) and de-serializing(反序列化) a Python object structure. "Pickling" i