Run Shell Scripts from Python like subprocesses
import subprocess
def runCommand(comm):
'''
Using the subprocess library this runs the command passed
'''
proc = subprocess.Popen(comm.split(), stdout=subprocess.PIPE)
outputstr = ''
for line in proc.stdout.readlines():
outputstr+=line.rstrip()+"\n"
return outputstr[:-1]