output of shell command

Joe Connellan joe at al.com.au
Mon Feb 26 01:49:01 EST 2001


How do I retrieve the output of a shell command in python?

eg

output = os.system('ls -l') - but returns the output of "ls -l"
or
output = `ls -l` - like perl

Thanks in advance

Joe



More information about the Python-list mailing list