The Ever-Useful and Neat Subprocess Module Originally Authored
By Shrikant Sharat Python's subprocess module is one of my
favourite modules in the standard library. If you have ever done
some decent amount of coding in python, you might have
encountered it. This module is used for dealing with external
commands, intended to be a replacement to the old os.system and
the like. The most trivial use might be to get the output of a
small shell command like ls or ps. Not that this is the best way
to get a list of files in a directory (think os.listdir), but
you get the point. I am going to put my notes and experiences
about this module here. Please note, I wrote this with Python
2.7 in mind. Things are slightly different in other versions
(even 2.6). If you find any errors or suggestions, please let me
know. A Simple Usage For the sake of providing context, lets run
the ls command from subprocess and get its output import
subprocess ls_output = subprocess.check_output(['ls']) I'll
cover getting output from a comman