Skip to content

Repository files navigation

from subprocess import run

The subprocess extension to run processes.

>>>fromsubprocessimportrun>>>run('uname -r').stdout3.7.0-7-generic>>>run('uname -a').status0>>>printrun('rm not_existing_directory').stderrrm: cannotremove `not_existing_directory': Nosuchfileordirectory>>>printrun('ls -la', 'wc -l')
14

To use pipe from the shell.

fromsubprocessimportrunrun('grep something', data=run.stdin)
$ ps aux | python script.py

Install

You can install it from PyPi, by simply pip:

$ pip install subprocess.run

to test it, launch python

>>>fromsubprocessimportrun

Supported platforms

  • Python2.6
  • Python2.7
  • Python3.3
  • PyPy2.1

Tests

https://travis-ci.org/xando/subprocess.run.png?branch=master
>>> python setup.py test

About

The subprocess module extension to run external processes.

Resources

Stars

22 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages