This package provides an drop-in alternative to
captures the output while still printing it in real time, just the way
Printing output in real-time while still capturing is important for any tool that executes long running child processes, as you may not want to deprive user from getting instant feedback related to what is happening.
# from subprocess import run from subprocess_tee import run result = run("echo 123") result.stdout == "123\n"
This libary also provides an drop-in replacement for rich Console class, one
that is able to rewire both
sys.stderr and avoid the
need too replace bare
print() calls with
# from rich.console import Console from subprocess_tee.rich import ConsoleEx console = ConsoleEx(redirect=True, record=True) print("123") assert "123\n" == console.export_text()
When used in conjuction with our own
run(), this also makes it possible
to use rich to process output produced by subprocesses.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size subprocess_tee-0.1.5-py3-none-any.whl (7.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size subprocess-tee-0.1.5.tar.gz (13.7 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for subprocess_tee-0.1.5-py3-none-any.whl