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

M

mikem76

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

Mike
 
F

Fredrik Lundh

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top