Using os.getpid 
Author Message
 Using os.getpid

When I do the following I get the PID of my python program:


I have hacked up the following workaround:
for line in os.popen("ps -ef | grep -i
/opt/tumbleweed/server/bin/IMEController | awk '{ if (NR > 1) { print
$0 }}'").readlines():
    pid = line[:-1]

Is there a version of os.getpid() that takes as an argument an
executable name/pathname and returns its PID? Or, is there a better
way to do this using existing modules and tools that isn't shell
and/or platform dependent?

Mon, 30 Dec 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. os._exit(), os.kill(os.getpid(), 9)

2. Q:Using REXX under OS/2 how can you change an OS/2 window size

3. Using os.system and os.popen from pythonwin under Windows NT

4. getpid(), atoi(), time functions in Ada 95

5. getpid Usage

6. What to learn using VW or OS for data analyzing

7. Using VA Smalltalk and DB2 under OS/390

8. VSE Smalltalk on FAST PCs using OS/2

9. Using quaternions in Mac OS X

10. Digitalk PARTS using OS/2 & IPF Help

11. Using 8156B RT controller's serial port in RT OS

12. using forth for an OS


Powered by phpBB® Forum Software