vik-y
5/14/2015 - 6:40 PM

Run shell command and capture output using python

Run shell command and capture output using python

def run_terminal(command):
        p = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        out, err = p.communicate()
        return out