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
背景 Requests is an elegant and simple HTTP library for Python, built for human beings. Requests是一个优雅简洁的Python HTTP库,给人类使用. Requests使用urllib3,所以拥有它的所有特性. 支持python 2.6 – 3.5 . 不得不说,超级喜欢他们家的文档啊,很pythonic. Requests: 让 HTTP 服务人类 快速上手 开发接口 Requests github 安
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