calling to the shell in python
This is one of the most frequent utility routines I have in many (most?) of my python scripts. Creating subprocesses in python is very flexble and powerful, but a bit verbose. Sometimes you just want to run a command and set a variable to the output.
from subprocess import Popen, call, STDOUT, PIPE
You can then just use this as: