All Projects → pycontribs → subprocess-tee

pycontribs / subprocess-tee

Licence: MIT license
A subprocess.run drop-in replacement that supports a tee mode, being able to display output in real time while still capturing it. No dependencies needed

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to subprocess-tee

fsig
Send signals to a subprocess when files change
Stars: ✭ 16 (-48.39%)
Mutual labels:  subprocess
enrich
Enrich adds few missing features to the wonderful rich library.
Stars: ✭ 20 (-35.48%)
Mutual labels:  pep-621
Delegator.py
Subprocesses for Humans 2.0.
Stars: ✭ 1,579 (+4993.55%)
Mutual labels:  subprocess
Sh
Python process launching
Stars: ✭ 5,963 (+19135.48%)
Mutual labels:  subprocess
Flask-Shell2HTTP
Execute shell commands via HTTP server (via flask's endpoints).
Stars: ✭ 93 (+200%)
Mutual labels:  subprocess
python-executor
Programmer friendly subprocess wrapper
Stars: ✭ 88 (+183.87%)
Mutual labels:  subprocess
ansible-taskrunner
Ansible Taskrunner - ansible-playbook wrapper with YAML-abstracted python click cli options!
Stars: ✭ 14 (-54.84%)
Mutual labels:  subprocess
subprocess
No description or website provided.
Stars: ✭ 49 (+58.06%)
Mutual labels:  subprocess
bkt
bkt is a subprocess caching utility, available as a command line binary and a Rust library.
Stars: ✭ 117 (+277.42%)
Mutual labels:  subprocess
pytest-subprocess
Pytest plugin to fake subprocess.
Stars: ✭ 83 (+167.74%)
Mutual labels:  subprocess
subprocess
A C++ high level library for running shell processes
Stars: ✭ 189 (+509.68%)
Mutual labels:  subprocess
ntee
Portable Unix shell command 'tee', with some extras - read from standard input and write to standard output and files
Stars: ✭ 22 (-29.03%)
Mutual labels:  tee
incubator-teaclave-trustzone-sdk
Teaclave TrustZone SDK enables safe, functional, and ergonomic development of trustlets.
Stars: ✭ 126 (+306.45%)
Mutual labels:  tee
gee
🏵 Gee is tool of stdin to each files and stdout. It is similar to the tee command, but there are more functions for convenience. In addition, it was written as go
Stars: ✭ 65 (+109.68%)
Mutual labels:  tee
sana
SANA, Storage Area Network Anywhere, a point-to-point encrypted storage area node network based on Swarm, is established by the Github geeks.
Stars: ✭ 16 (-48.39%)
Mutual labels:  tee
QwerteeTelegramBot
This bot shows you today's posts from Qwertee.
Stars: ✭ 18 (-41.94%)
Mutual labels:  tee
inclavare-containers
A novel container runtime, aka confidential container, for cloud-native confidential computing and enclave runtime ecosystem.
Stars: ✭ 510 (+1545.16%)
Mutual labels:  tee
multizone-linux
MultiZone® Security Enclave for Linux
Stars: ✭ 18 (-41.94%)
Mutual labels:  tee
Penglai-Enclave
This is the main repo for Penglai.
Stars: ✭ 47 (+51.61%)
Mutual labels:  tee

subprocess-tee

This package provides a drop-in alternative to subprocess.run that captures the output while still printing it in real-time, just the way tee does.

Printing output in real-time while still capturing is valuable for any tool that executes long-running child processes. For those, you do want to provide instant feedback (progress) related to what is happening.

# from subprocess import run
from subprocess_tee import run

result = run("echo 123")
result.stdout == "123\n"

You can add tee=False to disable the tee functionality if you want, this being a much shorter alternative than adding the well known stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL.

Keep in mind that universal_newlines=True is implied as we expect text processing, this being a divergence from the original subprocess.run.

You can still use check=True in order to make it raise CompletedProcess exception when the result code is not zero.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].