Python
Garysblog
lalala
展开
-
Python2.7 安装mock出现AttributeError: 'module' object has no attribute的解决方法
原环境:1.pip --verson : 1.0 from /usr/lib/python2.7/dist-packages (python 2.7)2.uname -a :Linux pc 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux3.root权原创 2017-02-18 10:34:02 · 19554 阅读 · 0 评论 -
gevent和requests同时使用报requests.exceptions.ReadTimeout:HTTPSConnectionPool(host='www.baidu.com', port=4
最近项目需要用协程来处理网站并发访问,使用了Gevent这个库,访问网站用requests,然而访问https的url时报错:>>> from gevent import monkey; monkey.patch_socket()>>> import gevent>>> url='https://www.baidu.com'>>> requests.get(url)requests.excep原创 2017-02-20 13:42:41 · 14773 阅读 · 0 评论 -
BeautifulSoup不能完整识别网页html代码
环境:Python版本:2.7.3>>> html = gethtml('http://www.joiway.com/')>>> soup = BeautifulSoup(html)>>> soup.find_all("a",href=True)[]>>> soup.find_all("a")[]>>> soup.find_all("link")[<link href="http://原创 2017-02-22 15:56:14 · 5244 阅读 · 0 评论 -
ImportError: No module named IPython.frontend.terminal.ipapp
环境:Ubuntu 12.04.5 LTS \n \l Python 2.7.13现象直接pip install ipython不能用 root@bdwaf:/usr/local/bluedon/python/cfpy/manager# ipython Traceback (most recent call last): File “/usr/bin/ipython”, line 5,原创 2017-12-27 19:41:35 · 3651 阅读 · 0 评论 -
数据库迁移工具 alembic 模仿git checkout 特定版本
alembic upgrade <target-revision> || alembic downgrade <target-revision>https://stackoverflow.com/questions/37035260/is-there-a-simple-way-to-tell-alembic-to-migrate-to-a-specific-revisio...转载 2018-06-15 16:26:51 · 395 阅读 · 0 评论