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

Discussion in 'Python' started by P.S., Apr 8, 2011.

  1. P.S.

    P.S. Guest

    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
    P.S., Apr 8, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. klappnase

    Capture PID of child process

    klappnase, Aug 5, 2003, in forum: Python
    Replies:
    4
    Views:
    484
  2. Tung Wai Yip
    Replies:
    1
    Views:
    775
    Anders Dalvander
    Oct 30, 2003
  3. tazimk

    obtaining pid of child process

    tazimk, Jul 26, 2010, in forum: Python
    Replies:
    1
    Views:
    727
    Chris Rebert
    Jul 26, 2010
  4. Miki Tebeka
    Replies:
    2
    Views:
    593
    Chris Angelico
    Apr 8, 2011
  5. Mav
    Replies:
    0
    Views:
    67
Loading...

Share This Page