Add tee like functionally to Popen
Project description
Teetime
Adding tee like functionally to subprocess.Popen
.
Installation
$ pip install teetime
How to use
There is some documentation in the code, and can be generated with tox -e docs
. Common usage is:
import sys
import teetime
with open('log.txt', 'wb') as f:
process = teetime.popen_call(
['python', 'test.py'],
stdout=(sys.stdout.buffered, f),
stderr=(sys.stderr.buffered, f),
)
process.wait()
Note: popen_call
blocks until IO is complete. If you have no IO, stdout=()
, then it will not block. This is why you still need process.wait()
.
Development
All tests use are run via tox. This includes running static analysis tools, unit tests and generating documentation.
$ tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
teetime-0.0.2.tar.gz
(5.4 kB
view hashes)