(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.
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
Core Modules
More Standard Modules
Threads and Processes
Data Representation
File Formats
Mail and News Message Processing
Network Protocols
Internationalization
Multimedia Modules
Data Storage
Tools and Utilities
Platform-Specific Modules
Implementation Support Modules
Other Modules