output of shell command

Sheila King sheila at spamcop.net
Mon Feb 26 22:09:15 CET 2001

On Tue, 27 Feb 2001 07:39:57 +1100, Joe Connellan <joe at al.com.au> wrote in
comp.lang.python in article <3A9ABF1D.EE79FCD3 at al.com.au>:

:Thanks guys for the help, one note is that os.popen().readlines() of
:course will return a list of strings - lines of output, whereas
:commands.getoutput() will return a single string. So both will come in
:Thanks again

You can return a single string by turning the readlines() into read()
like this:


Or, do this (silly):


Sheila King

More information about the Python-list mailing list