Skip to main content

A drop-in replacement for `subprocess.run` that captures stdout and stderr while also displaying output live in the console.

Project description

capture-run

A drop-in replacement for subprocess.run that captures stdout and stderr while also displaying output live in the console.

Installation

pip install capture-run

Usage

>>> from capture_run import run

>>> run("echo $ bytes")
$ bytes
CompletedProcess(args='echo $ bytes', returncode=0, stdout=b'$ bytes\r\n', stderr=b'')

>>> run("echo $ text", text=True)
$ text
CompletedProcess(args='echo $ text', returncode=0, stdout='$ text\n', stderr='')

>>> run("echo $ captured", capture_output=True, encoding="utf-8")
CompletedProcess(args='echo $ captured', returncode=0, stdout='$ captured\n', stderr='')

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

capture_run-0.0.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capture_run-0.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file capture_run-0.0.0.tar.gz.

File metadata

  • Download URL: capture_run-0.0.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.3 Windows/10

File hashes

Hashes for capture_run-0.0.0.tar.gz
Algorithm Hash digest
SHA256 b99b50f84fd300a8b4b6dd30e349b2f23c8feece85ed90541e1f523d6004f671
MD5 63470023c15ba7d8fb394d603aeeb858
BLAKE2b-256 419a57e5c478340d3a7c315925785ed7bcca679a53fc7082626071c60a241b5c

See more details on using hashes here.

File details

Details for the file capture_run-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: capture_run-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.3 Windows/10

File hashes

Hashes for capture_run-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 830af018a047406662bdadf235609ba0dbc12075e800596ef9f448fa41574b9d
MD5 292b305641a7610f222ba36f047f1206
BLAKE2b-256 7e8686dbdc15a1f0da5b46dc4176a10cac6c314f279c2ca3f809d48a00096451

See more details on using hashes here.

Supported by

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