跳转到主要内容

轻松捕获stdout和stderr。

项目描述

.. -*- restructuredtext -*-

.. highlight:: python

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

使用iocapture轻松捕获stdout和stderr。

如何使用
==========

Python >= 2.5:

import iocapture

with iocapture.capture() as captured
print("hello stdout")
print(captured.stdout)
# >>> hello stdout

Python < 2.5:

import iocapture

captured = iocapture.capture()
captured.start()
print("hello stdout")
captured.close()
print(captured.stdout)
# >>> hello stdout

变更日志
=========

https://github.com/oinume/blob/master/changes.rst


对于开发者
==============
以开发模式安装iocapture:

$ python setup.py develop

安装以下模块进行测试:

$ pip install -r requirements-dev.txt

运行测试:

$ py.test tests

项目详情


下载文件

下载适合您平台的项目文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

iocapture-0.1.2.tar.gz (12.6 kB 查看哈希值)

上传时间: 源代码

支持者