"vince spicer" <[email protected]> wrote
import commands
output = commands.getout("ls -lah")
There are many ways to do this in Python including
os.popen, commands and subprocess.
But subprocess is the "officially correct" version, the others
are deprecated and could theoretically disappear in a future
version of Python. (But not soon I suspect because of the
amount of legacy code that uses it!)
But its definitely worth weaning oneself onto subprocess
even though it is initially harder work. In the end the superior
flexibility and consistency of approach pay back.
Alan G.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor