process id from os.system

j vickroy jvickroy at sec.noaa.gov
Thu Jul 20 14:42:51 EDT 2000


How can I obtain the process id for a program launched via

  os.system (theProgram) ?

I would like to do this portability (Unix, Windows).

Presently on Unix, I'm getting the pid by parsing the output from:

  "ps -ef | grep theProgram"

but that seems messy and unreliable since "theProgram" may be truncated
in the output from ps.




More information about the Python-list mailing list