[Tutor] running process in parallel
Jeff Shannon
jeff at ccvcorp.com
Mon Oct 27 21:49:59 EST 2003
Daniel Ehrenberg wrote:
>>> i want to call and execute other programs
>>>parallely from python.is that
>>>possible.?what tools do i need?
>>
>>What type of programs and what do you mean by
>>"Parallely"? You can use
>>os.fork or many of its variants to start child
>>processes.
>
> Funny, the version of Python I'm using (2.3.2-1)
> doesn't have os.fork.
os.fork() is a *nix-only function. On Windows, something similar can
be done with the os.exec* family of functions.
It's also possible, on Windows, to use os.system("start file.ext") to
have the OS take the action that's associated with the given ext
(usually running a program and loading the named document). Unlike
fork() and exec*(), "start" will cause the program to run in a new
process, leaving the original process free to do other tasks. (I
believe that there's a comparable *nix command, but I'm not certain
what it is offhand...)
Jeff Shannon
Technician/Programmer
Credit International
More information about the Tutor
mailing list