subprocess.Popen howto?

Carl Banks pavlovevidence at gmail.com
Thu May 7 19:35:32 EDT 2009


On May 7, 2:58 pm, norseman <norse... at hughes.net> wrote:
> If you don't like a lot of typing that obscures the process,
> take a look at os.Popen2  Pg.39 or so in Lib.pdf for 2.5.2
> In this case - the popen3 is probably your best bet.
>
> I took a test run on "subprocess" a few months ago. My review:
> excessive typing to accomplish the simple.


Hmm, I won't argue that it can be excessive typing, but I think its
purpose isn't to accomplish the simple but to hit all the corners of
subprocesses.

What if you want os.system without the shell?  What if you want popen
with the shell?  On Windows what if I want a subprocess without a
console from a Python program in a console.  Stuff like that.

I still use os.system for Q&D stuff, but now use subprocess for
everything else since I prefer thorough to short and sweet.


Carl Banks



More information about the Python-list mailing list