How do I get the process id when starting a process using os.popen2 or os.popen3 on linux?

Discussion in 'Python' started by mikem76@gmail.com, Jun 7, 2006.

  1. Guest

    Is there a way to get the process id when starting a process using
    os.popen2 or os.popen3 on linux?

    Mike
     
    , Jun 7, 2006
    #1
    1. Advertisements

  2. Re: How do I get the process id when starting a process usingos.popen2 or os.popen3 on linux?

    wrote:

    > Is there a way to get the process id when starting a process using
    > os.popen2 or os.popen3 on linux?


    on Unix, os.popen2/popen3 uses functions and classes from the popen2
    module. they return file objects attached to the process, but there's
    no (non-hacky) way to get at the process itself.

    if you need more control over the subprocess, you can use the classes in
    the popen2 module, or, better, the subprocess module.

    </F>
     
    Fredrik Lundh, Jun 7, 2006
    #2
    1. Advertisements

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. Guest
    Replies:
    1
    Views:
    608
    Donn Cave
    Jun 15, 2004
  2. Jeffrey Barish

    Bug in popen2.Popen3?

    Jeffrey Barish, Jun 16, 2004, in forum: Python
    Replies:
    1
    Views:
    454
    Donn Cave
    Jun 17, 2004
  3. Ruchika
    Replies:
    1
    Views:
    392
    Larry Bates
    Sep 10, 2004
  4. Evgeni Sergeev
    Replies:
    2
    Views:
    520
    Jean Brouwers
    Dec 28, 2004
  5. alexrait1
    Replies:
    3
    Views:
    567
    Steven Bethard
    Mar 9, 2005
  6. Replies:
    3
    Views:
    11,708
  7. Jonathan Mark
    Replies:
    0
    Views:
    523
    Jonathan Mark
    Dec 21, 2006
  8. Christoph Krammer

    Using os.popen3() to get binary data

    Christoph Krammer, Apr 6, 2007, in forum: Python
    Replies:
    4
    Views:
    489
Loading...