Skip to main content

simple command-line wrapper

Project description

Note: Work in Progress.

This lib aims to provide a Human friendly interface for subprocess.

If you need piped subprocesses, give envoy a try.

https://img.shields.io/travis/SkyLothar/shcmd/master.svg?style=flat-square https://img.shields.io/coveralls/SkyLothar/shcmd/master.svg?style=flat-square https://img.shields.io/pypi/v/shcmd.svg?style=flat-square

Usage

import shcmd

with shcmd.cd("/tmp"):
    # get result directly
    assert shcmd.run("pwd") == "/tmp"
    # get streamed result packed in a generator
    streamed = shcmd.run("ls", stream=True)
    for filename in streamed.iter_lines():
        print(filename)
    # get full stdout/stderr
    print(streamed.stdout)
    print(streamed.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

shcmd-0.5.0.tar.gz (10.9 kB view hashes)

Uploaded Source

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