Having multiple instances of a single application start a single instance of another one

Troy Melhase troy.melhase at gmail.com
Fri Feb 23 17:57:06 EST 2007


> Three very simple questions then.
>
> 1. How do I find out a running applications process ID

import os
mypid = os.getpid()

> 2. How do I check if a process ID is bound to a running application.

this is os-specific.  i'm sure there's a windows api provided for it.

> 3. There won't be any issues with different applications trying to read
> and write the same file doing this?

shouldn't be any problem:  only the first app started will write to the file.



More information about the Python-list mailing list