execute commands independantly

Leif K-Brooks eurleif at ecritters.biz
Tue Sep 6 09:27:27 EDT 2005


Mike Tammerman wrote:
> Hi,
> 
> I am trying to execute an executable or a pyton script inside my
> program. I looked at the subprocess and os module. But all the
> functions in these modules blocks my application.

subprocess doesn't block unless you call .wait():

from subprocess import Popen
proc = Popen('sleep 2; echo "Hello, world!"', shell=True)
print "In two seconds, something will happen."
proc.wait()
print "Did you see that?"



More information about the Python-list mailing list