Skip to main content

run command

Project description

Install

$ [sudo] pip install runcmd

Features

  • minimalist design
  • easy debug

Examples

>> > import runcmd
>> > r = runcmd.run(["echo", "hello world"])

>> > r.code, r.out, r.err
(0, 'hello world', '')

_raise() - raise exception if code is not 0

>> > runcmd.run(["ls"])._raise()             # code 0, ok
>> > runcmd.run(["mkdir", "/"])._raise()      # code 1, error
...
OSError: exited with code 1
mkdir: /: Is a directory

ok - True if code is 0

>> > if r.ok:

Sources

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

runcmd-0.0.1.tar.gz (1.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page