A python library of subprocess module wrapper.
Project description
subprocrunner
Summary
A python library of subprocess module wrapper.
Examples
Execute a command
from subprocrunner import SubprocessRunner
runner = SubprocessRunner("echo test")
print("command: {:s}".format(runner.command))
print("return code: {:d}".format(runner.run()))
print("stdout: {:s}".format(runner.stdout))
runner = SubprocessRunner("ls __not_exist_dir__")
print("command: {:s}".format(runner.command))
print("return code: {:d}".format(runner.run()))
print("stderr: {:s}".format(runner.stderr))
command: echo test
return code: 0
stdout: test
command: ls __not_exist_dir__
return code: 2
stderr: ls: cannot access '__not_exist_dir__': No such file or directory
Get command history
from subprocrunner import SubprocessRunner
SubprocessRunner.clear_history()
SubprocessRunner.is_save_history = True
SubprocessRunner("echo hoge").run()
SubprocessRunner("echo foo").run()
print("\n".join(SubprocessRunner.get_history()))
echo hoge
echo foo
Installation
pip install subprocrunner
Dependencies
Python 2.7+ or 3.3+
Test dependencies
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
subprocrunner-0.8.0.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file subprocrunner-0.8.0.tar.gz
.
File metadata
- Download URL: subprocrunner-0.8.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba0995e8c769175727d03492d7a401786fdd906f3101a85f123c3923f190b1c8 |
|
MD5 | 7b3ab2f2fe705be71c8d2081bfc44db3 |
|
BLAKE2b-256 | 80e4492011be623ca0a15921780ffd5f73cb49d55e7dfa4a92218a4532369291 |
File details
Details for the file subprocrunner-0.8.0-py2.py3-none-any.whl
.
File metadata
- Download URL: subprocrunner-0.8.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6ed1d1f8dd6536d405a4d634260a2711fae271d9843822bf140e210205fe4f |
|
MD5 | 4455e191c14ed7417b18613243ea0161 |
|
BLAKE2b-256 | 34cce31ec36b369bd4ab847354f7a6b2c88e1222b08350a8dafd6446d6edf66a |