473,395 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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

Mike

Jun 7 '06 #1
1 1571
mi*****@gmail.com 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>

Jun 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: klappnase | last post by:
Hello, everyone, I am running python2.2.2 on a linux box. I want to call a shell command and get the PID of this child process so I have the possibility to abort the child process while it is...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
4
by: Daniel Timothy Bentley | last post by:
What is the (hopefully unique) obvious way of runnign a sub-process if I want to get the exit code and input without resorting to multi-threading? It seems like I should be able to do the...
1
by: Dave Sellars | last post by:
Is there really no way to run a sub-process, gather its stdout/stderr, and collect the return-code, on Win32??? But that's what the docs say... > These methods do not make it possible to...
1
by: | last post by:
This could possibly be a bug, but I don't understand it fully so I'm posting here first. Searching the list told me other people are having this problem too. I have created a class which...
4
by: P | last post by:
I've written a couple of apps that required running a command and grabbing the output, and I've found the existing interfaces problematic for this. I think the proliferation of functions and...
3
by: alexrait1 | last post by:
I launch my python. Then I write this: import popen2 popen2.Popen3("mplayer *.mpg") it starts playing for 2 seconds.. and then stops... if I quit python (ctrl - D) mplayer continues to run and...
3
by: ajikoe | last post by:
Hello, I would like to create python processes instead of thread. Can anyone give me an example or site which shows a tutorial about how to create processes ? Sincerely Yours, Pujo
3
by: rh0dium | last post by:
Hi all, Another newbie question. So you can't use signals on threads but you can use select. The reason I want to do this in the first place it I need a timeout. Fundamentally I want to run a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.