[Tutor] python's bash wait and ampersand equivalent?
kent37 at tds.net
Tue Apr 26 12:32:30 CEST 2005
chumpy town wrote:
> Hello all,
> I am trying to convert from bash to python for scripting. What is the
> simplest & cleanest way to do the following in python:
> for i in `seq 1 1000`
> my-other-script &
> echo "all done"
You might like the subprocess module - something like this (untested!):
from subprocess import Popen
procs = [ Popen("my-other-script") for i in range(1000) ]
for p in procs:
More information about the Tutor