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:
text
- out+err
>>> r.text
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for runcmd-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c17237c12c11c51c1cfc596f1f3268e8c93dc35069fc6fadd6a4706ea9553da |
|
MD5 | 2fe09ecfff57dcc400a0a683f2122f13 |
|
BLAKE2b-256 | e31e8938af718ed133d9c5e63f96c49e40af10d1e17eb7cb6f189df6aca2c33b |