很容易抓到stdout,stderr。

iocapture的Python项目详细描述


……-*-重组文本-*-

…亮点:python

…图片::https://secure.travis-ci.org/oinume/iocapture.png?branch=master


抓拍stdout,很容易用iocapture来抓拍stdout,也很容易用iocapture来抓拍stdout。如何用python>;=2.5:



































>如何用python&python>





<中尉;2.5::

import iocapture

captured=iocapture.capture()
captured.start()
print(“hello stdout”)
captured.close()
print(captured.stdout)
您好,stdout

===






::

$python setup.py develop

安装以下模块进行测试。::

$pip install-r requirements-dev.txt


运行测试::

$py.test测试

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spring框架服务单元测试   在Java中遍历hashmaps的hashmap以检索字符串值   如何使用CodeQL检查Java注释是否具有特定属性?   java为什么在Spring Boot中访问此资源而不是登录弹出窗口需要始终获得完全身份验证   处理将多集计数转换为列表的过程   java另一个线性布局,没有出现按钮   eclipse Java映像加载未显示在jar中   java Junit类无法加载基本测试类ApplicationContext   java如何在main中使用my getvalues()方法打印列表   java Sonar,S128:切换案例应该以无条件的“中断”语句结束,而不是继续   java从socket读取字符串错误连接重置错误   java使用新数据刷新任意图表饼图   java通过异步运行lambda访问方法参数   java错误的结果一旦我处理try and catch