(Unix only) The commands module contains a few convenience functions designed to make it easier to execute external commands under Unix. Example 3-7 demonstrates this module.
commands
Example 3-7. Using the commands Module
File: commands-example-1.py import commands stat, output = commands.getstatusoutput("ls -lR") print "status", "=>", stat print "output", "=>", len(output), "bytes" status => 0 output => 171046 bytes
status => 0
output => 171046 bytes
18.189.178.237