Skip to content

Capture stdout, stderr easily.

License

MIT, LGPL-2.1 licenses found

Licenses found

MIT
LICENSE
LGPL-2.1
COPYING
Notifications You must be signed in to change notification settings

oinume/iocapture

Repository files navigation

Capture stdout, stderr easily with iocapture.

How to use

With Python >= 2.5

import iocapture

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

With Python < 2.5

import iocapture

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

ChangeLog

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

For developers

Install iocapture in develop mode.

$ python setup.py develop

Install following modules for testing.

$ pip install -r requirements-dev.txt

Run tests

$ py.test tests

About

Capture stdout, stderr easily.

Resources

License

MIT, LGPL-2.1 licenses found

Licenses found

MIT
LICENSE
LGPL-2.1
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages