os.popen--which one to use?

Robert Kern robert.kern at gmail.com
Tue Apr 3 20:58:48 CEST 2007


Kevin Walzer wrote:
> I'm confused by the number of variations on "popen" that Python offers.
> 
> I'm using os.popen in my programs without difficulty. Is this wrong? 
> Should I be using popen 2, popen3, etc.? I'm not clear on what the 
> advantages of popen2, 3 etc. are: they seem a lot more complicated.

Use the subprocess module, instead. It makes all of the popen functions more or
less obsolete (it used to be called popen5 before it got moved into the standard
library).

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list