newbie system() question
James T. Dennis
jadestar at idiom.com
Sun Jun 16 18:37:06 EDT 2002
Dan Larsen <dl at bestpriceeu.com> wrote:
> Hi all :o)
...
> ... Isn't there a function, where all output
> from the command, is parsed to a variable?
I think you're thinking of popen()
There are several versions of popen() depending on whether you
want the just one pipe (stdin or stdout) or a pair of pipes (one
for input and another for output) a triplet of pipes (stdin,stdout,
stderr) or a pair with stdout and stderr combined into one stream,
etc.
There is also a popen2 module which allows you to subclass your
own popen class and then use the poll() or wait() methods to retrieve
the error/return code from the terminated subprocess.
> Thanx in advance :o)
> Dan Larsen
More information about the Python-list
mailing list