[Tutor] How to run two os.system commands simultaneously

Kent Johnson kent37 at tds.net
Thu Dec 17 15:52:34 CET 2009


On Thu, Dec 17, 2009 at 9:29 AM, pedro <pedrooconnell at gmail.com> wrote:
> Hi, I have two computationally intensive commands that I would like to
> render simultaneously on two fifferent computers. When I run these two
> commands,
>
> os.system(theTerminalCommandMacPro4)
> os.system(theTerminalCommandMacPro1)
>
>
> the second command doesn't begin until the first command has finished
> rendering. Is there a way to send them both off at the same time?

Use subprocess.Popen() to start the external process asynchronously:
http://docs.python.org/library/subprocess.html#replacing-os-system

Or call os.system() in a thread.

Kent


More information about the Tutor mailing list