Re: How to get a PID of a child process from a process openden with Popen()

2011-04-08 Thread Chris Angelico
On Sat, Apr 9, 2011 at 5:28 AM, Nobody wrote: > There isn't a robust solution to the OP's problem. It's typically > impossible to determine whether one process is an ancestor of another if > any of the intermediate processes have terminated. Upstart and gdb can both detect forks and follow the ch

Re: How to get a PID of a child process from a process openden with Popen()

2011-04-08 Thread Nobody
On Fri, 08 Apr 2011 07:43:41 -0700, Miki Tebeka wrote: >> p = subprocess.Popen(shlex.split("kdesu -u test program")) >> >> How can I aquire the PID of the program which kdesu starts? > > You can run "ps --ppid " and get the line containing test program. > The first field there should be the

Re: How to get a PID of a child process from a process openden with Popen()

2011-04-08 Thread Miki Tebeka
> p = subprocess.Popen(shlex.split("kdesu -u test program")) > > How can I aquire the PID of the program which kdesu starts? You can run "ps --ppid " and get the line containing test program. The first field there should be the child process id. HTH -- Miki Tebeka http://pythonwise.blogspo