python
文章平均质量分 78
永泉狂客
这个作者很懒,什么都没留下…
展开
-
python setup.py install 遇到 SyntaxError: operator not allowed in environment markers
python setup.py install 遇到 SyntaxError: ‘<’ operator not allowed in environment markersMarker evaluation failed, see the following error. For more information see: http://docs.openstack.org/pbr/l...原创 2020-05-07 11:26:05 · 617 阅读 · 0 评论 -
python中使用pymysql出现错误pymysql.err.operationalerror 2013
python中使用pymysql出现错误pymysql.err.operationalerror 2013具体问题:pymysql.err.OperationalError: (2013, ‘Lost connection to MySQL server during query’)使用flask-sqlalchemy遇到的问题,当较长时间没有去访问网站,再次打开时就会报一个数据库连接失败的错...原创 2020-03-11 20:52:41 · 6047 阅读 · 0 评论 -
python上下文管理器
python中的上下文管理器最常用在需要管理类似文件、网络连接和锁这样的资源的程序中。这些资源的关键点在于它们必须显式地进行关闭或释放才能正确工作。 通过实现上下文管理器,通过实现了__enter__()方法...原创 2019-07-08 10:44:13 · 237 阅读 · 0 评论 -
python使用zookeeper
1.安装zookeeper1)下载wget http://apache.01link.hk/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz2)安装tar -zxvf zookeeper-3.4.14.tar.gzcd zookeeper-3.4.11/confcp zoo_sample.cfg zoo.cfgvi zoo.cfg...原创 2019-07-08 13:14:19 · 917 阅读 · 0 评论 -
python中的tenacity 的简单使用
1.tenacity有什么用?Tenacity是一个通用的retry库,简化为任何任务加入重试的功能。它还包含如下特性:通用的装饰器API可以设定重试停止的条件(比如设定尝试次数)可以设定重试间的等待时间(比如在尝试之间使用幂数级增长的wait等待)自定义在哪些Exception进行重试自定义在哪些返回值的情况进行重试协程的重试2.为什么使用tenacity很多时候,我们都喜欢...原创 2019-07-08 14:13:22 · 7515 阅读 · 1 评论 -
安装lxc-python2失败
问题:[root@primary tools]# pip install lxc-python2DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that d...原创 2019-07-29 14:51:29 · 308 阅读 · 0 评论