How do I execute a command from within python and wait on that command?

Matt Nordhoff mnordhoff at mattnordhoff.com
Fri Feb 15 12:59:45 EST 2008


Rafael Sachetto wrote:
> os.system(command)
> 
> or
> 
> proc = popen2.Popen3(command)
> proc.wait()

I don't know about "cleanly terminat[ing] the command shell", but you
should use the subprocess module now, not any of the other functions
scattered around.
-- 



More information about the Python-list mailing list