Skip to main content

The subprocess module extension to run processes.

Project description

The subprocess extension to run processes.

>>> from subprocess import run

>>> run('uname -r').stdout
3.7.0-7-generic

>>> run('uname -a').status
0

>>> print run('rm not_existing_directory').stderr
rm: cannot remove `not_existing_directory': No such file or directory

>>> print run('ls -la', 'wc -l')
14

To use pipe from the shell.

from subprocess import run
run('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

>>> from subprocess import run

Supported platforms

  • Python2.6

  • Python2.7

  • Python3.3

  • PyPy1.9

Tests

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

Project details


Download files

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

Source Distribution

subprocess.run-0.0.7.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file subprocess.run-0.0.7.tar.gz.

File metadata

File hashes

Hashes for subprocess.run-0.0.7.tar.gz
Algorithm Hash digest
SHA256 af1d85fd485d56b32aeadd6e0e00398c002c2fe79846412fef582658dc3e71d2
MD5 c8233aecaa5cc8313f27f459808b3d6c
BLAKE2b-256 d92e1e20bb1cd489983d311f9c305fbeb61265e92027113df11f591d26359ad1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page