Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to get a PID of a child process from a process openden with Popen()

Reply
Thread Tools

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

 
 
P.S.
Guest
Posts: n/a
 
      04-08-2011
Hello,

I am starting a GUI-application as another user with kdesu in my python
script:

import shlex, subprocess

p = subprocess.Popen(shlex.split("kdesu -u test program"))

How can I aquire the PID of the program which kdesu starts?
p.pid just returns the PID of kdesu, but I need the PID of the
child process from kdesu.

My System: openSUSE 11.4 64-Bit, Python 2.7.

Regards
Pedro Santos
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
pexpect on windows - child process of another child process - quickquestion Z W Python 0 03-09-2013 10:00 PM
Re: How to get a PID of a child process from a process openden with Popen() Miki Tebeka Python 2 04-08-2011 10:35 PM
obtaining pid of child process tazimk Python 1 07-26-2010 04:29 AM
Capture PID of child process klappnase Python 4 08-06-2003 11:43 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57