python
phasorhand
不可分享的知识皆为伪
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Sphinx一分钟上手
1.安装sphinx 2. make html 3. 配置自动 3.1 sys.path 3.2翻译 2019-11-30 09:23:45 · 368 阅读 · 0 评论 -
Pytest
pytest 使用 . 标识测试成功(PASSED) 测试函数 断言 assert 捕获异常 with pytest.raises(Error) as e: connect('localhost', '6379') 查找测试策略 默认情况下,pytest 会递归查找当前目录下所有以 test 开始或结尾的 Python 脚本,并执行文件内的所有以 test 开始或结束的函数和方法。 标记测...转载 2019-11-20 17:25:30 · 250 阅读 · 0 评论 -
Manually raising (throwing) an exception in Python
转自Manually raising (throwing) an exception in Python def demo_bad_catch(): # Avoid raising a generic Exception try: raise ValueError('Represents a hidden bug, do not catch this') ...转载 2019-06-05 15:58:52 · 190 阅读 · 0 评论 -
Python自动生成requirements.txt
通过freeze pip freeze > requirements.txt 缺点: pip freeze saves all packages in the environment including those that you don’t use in your current project. (if you don’t have virtualenv) pip freeze o...原创 2019-05-31 17:20:24 · 306 阅读 · 0 评论 -
Multiprocessing Tutorial
转载自https://dzone.com/articles/python-201-a-multiprocessing-tutorial转载 2019-06-22 13:23:07 · 171 阅读 · 0 评论 -
ModuleNotFoundError: No module named 'XXX'
python程序在命令行执行提示ModuleNotFoundError: No module named ‘XXX’ 解决方法 查原因 观察 import sys print(sys.path) 调整到正确的路径 import sys sys.sys.path.append('.') print(sys.path) ...原创 2019-06-22 15:59:46 · 552 阅读 · 0 评论 -
RabbitMQ python
转自RabbitQM应用教程-Python版 工作队列 python pika 循环调度 默认来说,RabbitMQ会按顺序得把消息发送给每个消费者(consumer)。平均每个消费者都会收到同等数量得消息。这种发送消息得方式叫做——轮询(round-robin) 消息确认 为了防止消息丢失,RabbitMQ提供了消息响应(acknowledgments)。消费者会通过一个ack(响应),告诉R...转载 2019-08-30 10:51:29 · 199 阅读 · 0 评论
分享