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
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,
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
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
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
--
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
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
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,
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