Python Programming/External commands

The traditional way of executing external commands is using os.system:

The modern way, since Python 2.4, is using subprocess module:

The traditional way of executing external commands and reading their output is via popen2 module:

The modern way, since Python 2.4, is using subprocess module:

Keywords: system commands, shell commands, processes, backtick, pipe.