pyenv和pipenv打造python环境
摘要:https://www.jianshu.com/p/f15cb9571cab https://www.jianshu.com/p/d08a4aa0008e https://blog.csdn.net/swinfans/article/details/89305301
阅读全文
python垃圾回收
摘要:gc.collect方法默认不对重载了__del__方法的循环引用对象进行回收,而它们俩的状态也会从unreachable转变为uncollectable。由于是uncollectable的,自然就不会被collect处理,所以就进入了garbage列表。
阅读全文
python报错
摘要:from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object pip install --upgrade cffi
阅读全文
python起简易http server
摘要:python -m SimpleHTTPServer 9111
阅读全文
python 打印的异常回溯和代码不对应
摘要:正在运行的程序没有停止 又重新install了导致site-packages里的代码改变 正在运行的是老代码, 当出现异常时打印的行数是老代码,但显示的行的内容时新代码
阅读全文
oslo_messaging使用eventlet executor时rpc无法调用的问题
摘要:python2.7.5 oslo.messaging==9.8.0 现象: 从debug日志可以看到rpcServer接收到了rabbitmq的消息, 但是没有调用endpoints中的相应方法 分析: 当executor="eventlet"时 MessageHandlingServer中的_wo
阅读全文
py2与py3区别总结
摘要:1. py2中的str是py3中的bytes py2中的Unicode是py3中的str 声明一个字符串变量时,py2 和py3都是str类型,但py2代表字节类型,py3代表文本类型 隐式转换: py2 在处理不同类型时会转成unicode类型进行操作 py3 不会进行隐式转换, 不同类型操作会报
阅读全文
pip 离线安装
摘要:pip download ansible -d . --trusted-host mirrors.aliyun.com pip install ansible-2.7.5.tar.gz --user --no-index --find-links=.
阅读全文
爬虫之scrapy-splash
摘要:https://blog.csdn.net/zhusongziye/article/details/80378205 https://github.com/scrapy-plugins/scrapy-splash#configuration https://blog.csdn.net/qq_4133
阅读全文
windows 激活venv问题
摘要:.\ven\Scripts\activate.\ven\Scripts\activate : 无法加载文件 D:\github\ven\Scripts\activate.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?Link
阅读全文
Microsoft Visual C++ Compiler for Python 2.7
摘要:https://www.microsoft.com/en-gb/download/details.aspx?id=44266
阅读全文
flask_script 创建自定义命令行
摘要:创建管理员账号: 在服务器部署后,由于管理员账号没有申请的路径,需要在一开始的时候设定管理员账号,如果使用过程中需要新增管理员账号,十分不方便,在flask_script中可以通过命令行的方式增加管理员,就可以不影响服务器运行的情况下增加管理员账号. 实例: from info.models imp
阅读全文
python 删除模块
摘要:import systry: import librabbitmqexcept Exception: passelse: version = getattr(librabbitmq, '__version__', None) if version == '1.0.3': sys.modules['l
阅读全文
vc for python2.7
摘要:https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
阅读全文
python install
摘要:apt-get install python-pip3
阅读全文
pipeenv error
摘要:[root@mhc tmp]# pipenv --python 3.6Creating a virtualenv for this project…Using /root/python3/bin/python3.6m (3.6.4) to create virtualenv…⠋Running vir
阅读全文