Skip to main content

run command

Project description


$ [sudo] pip install runcmd


>>> import runcmd
>>> r =["echo", "hello world"])
>>> r.code  # exit status code
>>> r.out  # stdout
'hello world'
>>> r.err  # stderr
>>>  # process pid

background - add background=True

>>> r =["sleep","5"],background=True)
>>> while r.running:  # True if process is running and not "zombie process"
>>>     print("running")

_raise() - raise exception if code is not 0

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

ok - True if code is 0

>>> if r.ok:

text - out+err

>>> r.text

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.3.tar.gz (2.2 kB view hashes)

Uploaded source

Built Distribution

runcmd-0.0.3-py2.py3-none-any.whl (2.8 kB view hashes)

Uploaded py2 py3

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