os.system and command output

A.M alanalan at newsgroup.nospam
Wed Jun 7 21:08:09 CEST 2006


Hi,



How can I run an OS command and have the command's output (to stdout) in my 
string variable?



For example in windows, this command should return a list of files within 
directory:



os.system("DIR")



I am looking for an alternative function that returns the DIR command output 
in a string



Thanks,

Alan





More information about the Python-list mailing list