Problem using commands.getoutput()

J dreadpiratejeff at gmail.com
Tue Dec 8 15:04:13 EST 2009


On Tue, Dec 8, 2009 at 14:44, Jerry Hill <malaclypse2 at gmail.com> wrote:

> At the very top of http://docs.python.org/library/commands.html it
> says "Platforms: Unix", so yes, it's Unix-only.

That sound you hear is me beating my head against the table now...
sigh... I was too wrapped up in reading the actual code to notice the
comments...

> Also at the top of that same bit of documentation is this: "The
> subprocess module provides more powerful facilities for spawning new
> processes and retrieving their results. Using the subprocess module is
> preferable to using the commands module."
>
> I would start with http://docs.python.org/library/subprocess.html and
> http://www.doughellmann.com/PyMOTW/subprocess/ for more information
> about the subprocess module and how it works.

And thanks for the pointer to subprocess.  I'll read over that (ALL of
it) and learn some more...  right now I'm doing it just using
os.popen() and dumping the read() results to a list, but I'm all for
learning different ways of accomplishing the task.  I do appreciate
the info!

Jeff



-- 

Samuel Goldwyn  - "I'm willing to admit that I may not always be
right, but I am never wrong." -
http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html



More information about the Python-list mailing list