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.5.0.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file subprocrunner-0.5.0.tar.gz
.
File metadata
- Download URL: subprocrunner-0.5.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf98dda16760388cfe2d4833d70d63bc103694aa5f0804b316d62ff8dc27512c |
|
MD5 | 14b7465301feb56cece37c8f05ca3cb6 |
|
BLAKE2b-256 | cfeecb87f97b50d49d29de8c249729b4c532b4ee7f1225cb54960f2669a56b28 |
File details
Details for the file subprocrunner-0.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: subprocrunner-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362fc82addb4f5ec25f0db7167f6dbdd40ab6a7e762428811c1444c7062b72aa |
|
MD5 | 586afc00d99429fe3d6863e32ab29530 |
|
BLAKE2b-256 | a310b8f109b69a7006d85c9e2b44f4b0a6dd70ad32431078a77be70a9461a489 |