[Tutor] python's bash wait and ampersand equivalent?

Alan Gauld alan.gauld at freenet.co.uk
Tue Apr 26 22:58:12 CEST 2005


> You might like the subprocess module - something like this
(untested!):

Yikes, even more batteries. When did that appear, I've never seen
it before! - Aha! Its 2.4 that's why I havemn't seen it, as ever I
am one release behind the bleeding edge on 2.3...

> from subprocess import Popen
> procs = [ Popen("my-other-script") for i in range(1000) ]
> for p in procs:
>    p.wait()

p.wait will be called for each process in the list so its not quite
the same as a single os.wait but then that might be what's wanted!

Alan G.



More information about the Tutor mailing list