Capturing output of os.system to a string

gerry.butler gabutler at acslink.net.au
Mon Nov 23 21:11:08 EST 2009


Thank you. I'll look at subprocess.

I have since found that commands will do it too, eg,

(status, txt) = commands.getstatusoutput('whoami')

or txt = commands.getoutput('whoami')






More information about the Python-list mailing list