Inconsistence syntax in os module?

Michael Hudson mwh at python.net
Tue Feb 5 10:56:48 CET 2002


Lars Kellogg-Stedman <lars at larsshack.org> writes:

> Howdy all,
> 
> I'm growing increasingly frustrated with the os module, in particular
> with its implementation of the system() and popen() calls.  The
> traditional (e.g., libc) implementation of both of these calls spawns
> a /bin/sh process to run the command, with the associated problems of
> shell metacharacter interpretation, the cost of an extra fork(), and
> so forth.

The os.system and os.popen functions call the libc system & popen
functions.  This is what most functions in os are; thin wrappers
around the libc functions of the same name.

If you want control, you know where to find it -- popen2, or using
fork & exec yourself.

Cheers,
M.

-- 
  Like most people, I don't always agree with the BDFL (especially
  when he wants to change things I've just written about in very 
  large books), ... 
         -- Mark Lutz, http://python.oreilly.com/news/python_0501.html



More information about the Python-list mailing list