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
>>> 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.5.tar.gz
(4.1 kB
view details)
File details
Details for the file subprocess.run-0.0.5.tar.gz
.
File metadata
- Download URL: subprocess.run-0.0.5.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7e711ba432fac17479652a6b9f4191d1221e7e1a1ffbf19a08ee2a6a070ba21 |
|
MD5 | 177ad475d7a3222003fecf5a0ab7a1c1 |
|
BLAKE2b-256 | 1097a22a454095032e0a1bd615aada4be57541437dcf98371b5edeb0426213f0 |