会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Twotigers
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
···
13
下一页
2019年4月18日
concurrent.futures 学习笔记
摘要: concurrent.futures 先看下官方介绍 重点是 concurrent.futures._base.Executor submit(fn, args, kwargs) Future map(func, iterables, timeout=None, chunksize=1) typin
阅读全文
posted @ 2019-04-18 19:33 两只老虎111
阅读(661)
评论(0)
推荐(0)
2019年4月5日
在asyncio 中跳出正在执行的task
摘要: 需求描述 代码在 的框架中运行, 但是一旦一个 出现了长时间的堵塞,我们要跳过这个 (代码可能是用户输入的,例如用户编写的插件) 代码如下 (其中大部分代码出自官方的 "asyncio" 以及 "signal" ) 重点的函数在于 详情查看上面的链接 运行结果如下 这样就可以跳过被长时间堵塞的tas
阅读全文
posted @ 2019-04-05 23:08 两只老虎111
阅读(875)
评论(0)
推荐(0)
2019年4月4日
python 单元测试中处理用例失败的情况
摘要: 今天有一个需求, 在单元测试失败的时候打印一些日志, 我们管他叫 dosomething 吧 ,反正就是做一些操作 查了下并没有查到相关的方法, 于是研究了一波 的源码 发现了这个东西 其中重点关注下 这个正是我们执行的用例 于是去看了下 用例失败的处理是在这里进行处理的 奈何, 他只是在 (其中s
阅读全文
posted @ 2019-04-04 22:23 两只老虎111
阅读(3064)
评论(2)
推荐(1)
tmp\
摘要: unittest.case.TestCase _feedErrorsToResult def _feedErrorsToResult(self, result, errors): for test, exc_info in errors: if isinstance(test, _SubTest):
阅读全文
posted @ 2019-04-04 18:57 两只老虎111
阅读(168)
评论(0)
推荐(0)
2019年3月30日
Python asyncio
摘要: 最近在看 ayncio 这块内容 于是打算从 asyncio.run 这个 函数作为入口看下内部是如何工作的 下面是源码以及一些分析 如有问题, 欢迎交流 另外 有没得大佬晓得 博客园的 markdown 怎么显示行号啊 python def run(main, , debug=False): if
阅读全文
posted @ 2019-03-30 22:43 两只老虎111
阅读(1034)
评论(1)
推荐(0)
2019年3月20日
Ubuntu 终端配置
摘要: 安装zsh 设置 为默认shell 恢复 使用 安装 "Oh My Zsh" 配置语法高亮 "zsh syntax highlighting" 配置自动补全 "zsh autosuggestions.zsh"
阅读全文
posted @ 2019-03-20 13:19 两只老虎111
阅读(1706)
评论(0)
推荐(0)
2019年3月19日
ubuntu 安装 Pycharm
摘要: 官方推荐使用 snap 安装 安装指定版本的pycharm 下载本地之后安装: 实际上第二条命令需要使用 另外国内网络使用 snap 会巨慢, 百度云链接 链接: https://pan.baidu.com/s/1mUA9g fojhRd Qucos9S8w 提取码: u4qc 此版本为 历史版本下
阅读全文
posted @ 2019-03-19 23:10 两只老虎111
阅读(922)
评论(0)
推荐(0)
nginx (待更新)
摘要: install apt install nginx 默认在 /etc/nginx 目录下 一个 master 以及多个 worker bash 3504 root 20 0 141M 7196 5552 S 0.0 0.4 0:00.03 nginx: master process nginx 61
阅读全文
posted @ 2019-03-19 10:31 两只老虎111
阅读(153)
评论(0)
推荐(0)
2019年3月18日
根据 thread id 停止一个线程
摘要: 出自 https://github.com/Bogdanp/dramatiq/blob/master/dramatiq/middleware/threading.py#L62 https://docs.python.org/3/c-api/init.html#c.PyThreadState_SetA
阅读全文
posted @ 2019-03-18 09:47 两只老虎111
阅读(846)
评论(0)
推荐(0)
2019年3月15日
Redis 消息订阅
摘要: 参考 : https://github.com/andymccurdy/redis-py
阅读全文
posted @ 2019-03-15 11:16 两只老虎111
阅读(213)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
13
下一页
公告