Skip to main content

A tool to run another shell command, and color the stdout/stderr streams green/red

Project description

color_stream

A quick Python script to run another shell command, and split/color the stdout/stderr streams green/red

Story

While working with redirecting and assessing the output from another CLI tool, I needed a way to see what was going to stderr, and what was going to stdout.

This tool highlights the two streams, in real time.

Usage

pip install color_stream

color_stream '<another command here>'
## OR ##
python3 -m color_stream '<another command here>'

# test it with the demo script in this repo
color_stream python demo_1.py

# test it with "ls" (success, and error with file that doesn't exist)
color_stream ls file_that_exists.txt file_that_does_not_exist.txt

Limitations

  • reading from stdin is untested, and likely doesn't work
  • throughput speed is currently not benchmarked
  • switching colors is not currently supported

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

color_stream-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

color_stream-0.1.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file color_stream-0.1.0.tar.gz.

File metadata

  • Download URL: color_stream-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for color_stream-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2699a032c045000f01d1a76edcbecf58d84f43def640cd28aaeb27ebf2cd8152
MD5 1502deae729bc9ec6efa1fc7c14ccdcc
BLAKE2b-256 d49b23ced8db9e11b10b8751f3592e986e2c1a53660e62dcda8598a7ec3359aa

See more details on using hashes here.

File details

Details for the file color_stream-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for color_stream-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 167bd0d4c0964fb550343c6f74172e4038c98fadacf581e4efb1be0a0552c89d
MD5 d2812009195db8495bf0dc7021226805
BLAKE2b-256 b17a592f91e149389c9658aab6126ee0006d31a9e7f3c40dc32f9e38191bcf30

See more details on using hashes here.

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