Skip to main content

A Python wrapper library for subprocess module.

Project description



A Python wrapper library for subprocess module.


Execute a command

Sample Code:
from subprocrunner import SubprocessRunner

runner = SubprocessRunner("echo test")
print("command: {:s}".format(runner.command))
print("return code: {:d}".format(
print("stdout: {:s}".format(runner.stdout))

runner = SubprocessRunner("ls __not_exist_dir__")
print("command: {:s}".format(runner.command))
print("return code: {:d}".format(
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

dry run

Get execution command history

Sample Code:
from subprocrunner import SubprocessRunner

SubprocessRunner.is_save_history = True

SubprocessRunner("echo hoge").run()
SubprocessRunner("echo foo").run()

echo hoge
echo foo

Get a command information

>>> from subprocrunner import Which
>>> which = Which("ls")
>>> which.is_exist()
>>> which.abspath()
>>> which
command=ls, is_exist=True, abspath=/usr/bin/ls


pip install subprocrunner


Python 2.7+ or 3.3+

Test dependencies

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for subprocrunner, version 0.10.0
Filename, size File type Python version Upload date Hashes
Filename, size subprocrunner-0.10.0-py2.py3-none-any.whl (8.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size subprocrunner-0.10.0.tar.gz (8.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page