TypeError: a bytes-like object is required, not 'str'

json.decoder.JSONDecodeError: Extra data

json文件太大,改为单行读取:

with open("a", "r+") as f:
data = json.load(f) 改为: with open("a.json", "r+") as f:
data = f.readline()

UnicodeEncodeError: 'gbk' codec can't encode character u'\xe7' in position

将 print(res.txt) 改成 print(res.text).encode('gbk','ignore')

Https相关

  requests发送HTTPS
前提:verify=False
报错:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
解决:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 多线程 - connectionpool.py https请求 InsecureRequestWarning
解决:注释掉connectionpool.py的845-851行

 

IDE相关

 Pycharm
全局查询关键字
按快捷键Ctrl + Shift + F或从从菜单Edit-》Find-》Find in Path进入全局查找界面

 

爬虫相关

Max retries exceeded with url
.requests.adapters.DEFAULT_RETRIES =
.s = requests.session()
s.keep_alive = False

 

Pycharm

File size exceeds configured limit 2.5M. Code insight features not available
help -》Edit custom properities -》输入 idea.max.intellisense.filesize=

 

字节/字符转换问题

TypeError: a bytes-like object is required, not ‘str’
str -》 encode()-》bytes
bytes -》decode() -》str

 

共存

python3-m pip install --upgrade pip --force-reinstall 
python2-m pip install --upgrade pip --force-reinstall

netaddr

用途
ip地址管理

安装

pip3 install netaddr

模块 - Queue

用途
队列 使用
from queue import Queue

包安装报错

Crypto.Cipher

最新文章

  1. Xamarin教程索引页
  2. MVC+UnitOfWork+Repository+EF 之我见
  3. python操作TexturePacker批量打包资源plist png
  4. redis实现有序的消息队列
  5. POJ 1840 Eqs 暴力
  6. FE—— Code First 初体验 01(转)
  7. zabbix3.0.3 设置邮件报警
  8. 第一个java程序
  9. Ceph对象存储网关中的索引工作原理<转>
  10. SDP
  11. C#常用8种排序算法实现以及原理简介
  12. [flask实践] 解决qq邮箱/mysql的相关配置问题
  13. chrome console的使用 : 异常和错误的处理 – Break易站
  14. pandas小记:pandas基本设置
  15. ionic3使用cordova创建自定义插件
  16. java 日志框架
  17. 自学Linux Shell17.1-正则表达式
  18. 启明星请假系统appform:流程在线帮助
  19. Instagram/IGListKit 实践谈(UICollectionView框架)
  20. DCOS :私有云的物理基础架构管理引擎

热门文章

  1. [常用类]Math、Random、System、BigInteger、BigDecimal
  2. Appscan工作原理详解
  3. java synchronized实现可见性对比volatile
  4. ofbiz idea 启动
  5. 你浏览器的书签栏还够用么? - 程序员学点xx 特辑
  6. Linux基础命令一(补充)
  7. zTree根节点默认打开
  8. python3.7爬取墨菲定律保存在本地txt
  9. nginx windows 代理 80端口 500
  10. alert(1) to win 15