threading ---- python multi-threading Python 多线程
强制终止线程
| |
pyinstaller ---- executable maker for python, Python 程序包装成可执行文件
Max Recursion Exceeded
- 设置最大循环数
| |
收集动态导入模块 hidden modules
| |
多进程 multiprocessing 支持
aiohttp ---- Async IO Web Framework
Client
ClientSession
response
- resp.status
一次性读取内容
resp.text()
- 文本 str 类型
- resp.text(encoding='gbk')
resp.read()
- bytes 类型
resp.json()
- 提取 json
流模式读取 Streaming Response Content
- resp.content.read(10)
request
- session.get
- session.put
关键字参数 arguments
params
- 格式:http://hello.com?key=value&key1=vale1
- session.get(http://hello.com, params=params)
json
- session.post(url, json={'test': 'value'})
Post 请求
cryptography ---- python encryption library 加密类库
英语术语
| Words | Explanations |
|---|---|
| symmetric cipher | 对称加密 |
| message digest | 类似 md5, sha1 等等 |
Tutorial
安装
pip install cryptography
Network ---- 计算机网络基础知识
名词辨析
localhost 与 127.0.0.1
https://stackoverflow.com/a/7382629
- localhost 是域名,类似 baidu.com
使用 localhost, 程序会再查询 localhost 对应的 ip
- 有可能,用户自定义了配置,导致 localhost 对应到别的 ip
- 127.0.0.1 直接都应 ip,不需要查询