skip to navigation
skip to content

Not Logged In

shelljob 0.3.4

Run multiple subprocesses asynchronous/in parallel with streamed output/non-blocking reading

Package Documentation

Latest Version: 0.4.3


A simple way to manage several parallel subprocesses. This provides for asynchronous processes and non-blocking reading of their output.

Parallel Subprocesses

Using the Job system is the quickest approach to just run processes and log their output (by default in files named '/tmp/job_ID.log')

from shelljob import job

jm = job.FileMonitor()[
    [ 'ls', '-alR', '/usr/local' ],
    [ 'my_prog' ],
    [ 'build', 'output', 'input' ],

Note the command items are lists passed directly to subprocess.Popen.

The lower level Group class provides a simple container for more manual job management.

from shelljob import proc

g = proc.Group()
p1 = [ 'ls', '-al', '/usr/local' ] )
p2 = [ 'program', 'arg1', 'arg2' ] )

while g.is_pending():
    lines = g.readlines()
    for proc, line in lines:
        sys.stdout.write( "{}:{}".format(, line ) )

Simple Subprocess calls

A simplified call function allows timeouts on subprocesses and easy acces to their output.

from shelljob import proc

# capture the output
output = 'ls /tmp' )
# this raises a proc.Timeout exception 'sleep 10', timeout = 0.1 )


You can use my Launchpad project to submit issues.

File Type Py Version Uploaded on Size
shelljob-0.3.4.tar.gz (md5) Source 2013-10-31 47KB
  • Downloads (All Versions):
  • 24 downloads in the last day
  • 153 downloads in the last week
  • 3055 downloads in the last month