Capturing output of os.system to a string

gerry.butler gabutler at acslink.net.au
Tue Nov 24 03:11:08 CET 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