Skip to main content

Add tee like functionally to Popen

Project description

Build Status

About

Adding tee like functionally to subprocess.Popen.

Installation

$ python -m pip install teetime

Documentation

Documentation is available via GitHub.

Basic Usage

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().

Testing

To run all tests run nox. No venv is needed; nox makes all of them for us.

$ python -m pip install --user nox
$ git clone https://peilonrayz.github.io/teetime/
$ cd teetime
teetime $ nox

License

TeeTime is available under the MIT license.

Project details


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.3.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

teetime-0.0.3-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page