Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Make shell script running in a Pythonic way.

Project Description


Running shell in a Pythonic way.


$ pip install simplerun



>> from simplerun import run
>> r = run('ls -l')
>> r
<[0] `ls -l`>

0 refers to the exit code here.

>> print r.std_out
total 8
-rw-r--r-- 1 yj staff 664 11 19 21:46
-rw-r--r-- 1 yj staff 829 11 18 22:39
drwxr-xr-x 6 yj staff 204 11 19 21:46 simplerun

Iterable as input

>> with open('') as data:
>>     r = run('grep def', data)
>> print(r.std_out)

Result as input

>> r_data = run('ps aux')
>> r = run('grep Chrome', r_data)


>> r = run('ps aux | stranger | grep keyword')
>> r
<[-1] `stranger`>
>> r.exc
OSError(2, 'No such file or directory')

Found the stanger is the evil

>> r.history
[<[0] `ps aux`>]

review history, and keep going with good input:

[['grep', 'keyword']]
>> r2 = run(, '''Good line that contains the keyword
                       but not this line, sorry.''')
>> print(r2.std_out)
'Good line that contains the keyword\n'

Concurrent & Parallel

>> batches = ['ps', 'top -n 10', 'uptime']
>> r = prun(batches)  # paralell running
>> r2 = concurrent_run(batches)  # or, running in a concurrent mode
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
simplerun-0.3.2.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Dec 2, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting