Re: how to start a process and get it's pid?

2005-11-14 Thread J Correia
Peter Hansen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Fredrik Lundh wrote: Daniel Crespo wrote: os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) 1944 I don't get the correct PID. When I do os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) I get 168 (for example), while in

how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
Hello, another question rose for me today... Is there a way to start an external process, in it's own context (not as the exec-() functions do), and get it's pid...? e.g.: pid = wonderfulstartprocfunction('/usr/bin/wine bla.exe') #... later if (...): os.kill(pid,9) best regards,

Re: how to start a process and get it's pid?

2005-11-11 Thread Gerhard Häring
Yves Glodt wrote: Hello, another question rose for me today... Is there a way to start an external process, in it's own context (not as the exec-() functions do), and get it's pid...? [...] Check out the subprocess module if you're using Python 2.4. Otherwise, you can always use

Re: how to start a process and get it's pid?

2005-11-11 Thread Fredrik Lundh
Daniel Crespo wrote: os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) 1944 I don't get the correct PID. When I do os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) I get 168 (for example), while in the tasklist appears notepad.exe with the 2476 PID. Why? not sure, but the return value

Re: how to start a process and get it's pid?

2005-11-11 Thread Daniel Crespo
Hi os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) 1944 I don't get the correct PID. When I do os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) I get 168 (for example), while in the tasklist appears notepad.exe with the 2476 PID. Why? Thanks Daniel --

Re: how to start a process and get it's pid?

2005-11-11 Thread Daniel Crespo
import subprocess p = subprocess.Popen(c:/windows/notepad.exe) p.pid 1948 Yes, it works. But in my case, I need to run the program totally separated from my main program. So, when I start a new program through subprocess, it doesn't unlink. I mean, if I close my main app, so does the

Re: how to start a process and get it's pid?

2005-11-11 Thread Daniel Crespo
not sure, but the return value looks like a PID, so maybe you're seeing the PID for the cmd.exe instance used to run the program. or something. No. There wasn't a 196 PID for any of the processes. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
Gerhard Häring wrote: Yves Glodt wrote: Hello, another question rose for me today... Is there a way to start an external process, in it's own context (not as the exec-() functions do), and get it's pid...? [...] Check out the subprocess module if you're using Python 2.4. Otherwise,

Re: how to start a process and get it's pid?

2005-11-11 Thread Peter Hansen
Fredrik Lundh wrote: Daniel Crespo wrote: os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) 1944 I don't get the correct PID. When I do os.spawnl(os.P_NOWAIT, c:/windows/notepad.exe) I get 168 (for example), while in the tasklist appears notepad.exe with the 2476 PID. not sure, but the return