随笔分类 - Python
摘要:fiddler是抓http的利器,我们可以重放、调整参数来验证接口情况。当python程序发出的请求出现异常时,可以设置requests的proxy为fiddler的监听地址发出请求,这样就可以在fiddler中对比原始的请求数据。requests设置代理也很简单: r = requests.get
阅读全文
摘要:前言 公司业务中使用的备份工具一直是alicloud-duplicity,一直也没研究。后来业务出问题了,看了看,原来是基于duplicity开发的,使用了半天,感觉很不错,我感觉他的特点有: 加密备份 支持多种协议 内置了主流的存储商的backends:Azure、AWS S3、onedrive
阅读全文
摘要:loguru是个非常好用的三方日志管理包,简单易用,奈何老是记不住,在这记录一下吧 #coding:utf-8 ''' @version: python3.8 @author: ‘eric‘ @license: Apache Licence @contact: steinven@qq.com @so
阅读全文
摘要:太懒了,直接说原因吧: 请求返回的内容含有emoji表情 我的解决办法是替换掉emoji字符: 安装库:pip install emoji 替换:emoji.demojize(CONTENT) 注意,如果还有乱码,请将返回的内容再编码一下r.encoding='utf-8'
阅读全文
摘要:安装 pysocks:pip install pysocks # coding:utf-8 ''' @version: python3.6 @author: ‘eric‘ @license: Apache Licence @contact: steinven@qq.com @software: Py
阅读全文
摘要:找了好久这个问题,有人说是tcps的问题,需要自己生成证书什么的,后来才发现原来是 钱包文件路径 的问题,钱包文件解压后必须放在instantclien/network/admin下,在Windows和Linux平台下都测试了,确实是路径导致的。 剩下的按照文档来就可以了,环境变量什么的,都很简单,
阅读全文
摘要:#!/usr/bin/env python3 # -*- coding: utf-8 -*- from sqlalchemy import Column, String, create_engine, Integer, MetaData, Table from sqlalchemy.ext.decl
阅读全文
摘要:问题表现: 检查一下正常的请求头里面accept-encoding字段是否包含br,如果包含,果断pip install urllib3[brotli],详见ssl-warnings 记录另外一个问题: 若错误中含Caused by ProxyError('Cannot connect to pro
阅读全文
摘要:编译安装的话,之前遇到过很多小问题,感觉还是通过添加这个ppa方式装的比较稳,缺点是可能安装的比较慢,可配合proxychain4 sudo apt install software-properties-common -y sudo add-apt-repository ppa:deadsnake
阅读全文
摘要:在目录site-packages\PyInstaller\hooks下新建对应文件hook-对应三方库名字.py,如hook-ngender.py 编辑hook-ngender.py: from PyInstaller.utils.hooks import collect_data_files da
阅读全文
摘要:pip uninstall pyinstaller pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
阅读全文
摘要:ubuntu: Cenos: 重新编译:
阅读全文
摘要:python 在 Windows下使用AES时要安装的是pycryptodome 模块 pip install pycryptodome python 在 Linux下使用AES时要安装的是pycrypto模块 pip install pycrypto
阅读全文
摘要:`unset all_proxy && unset ALL_PROXY`
阅读全文
摘要:https://www.cnblogs.com/asmer stone/p/5470144.html
阅读全文
摘要:解决办法: 安装 `sudo apt get install python3 distutils`
阅读全文
摘要:一、安装uwsgi uwsgi是python的一个模块,安装uwsgi只需简单的pip命令就可以了 二、基于uwsgi+django的实现 使用命令启动uwsgi 切换至django项目 命令测试启动 参数说明: http 这个就和runserver一样指定IP 端口 file 这个文件就里有一个反
阅读全文