This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shlex | |
import subprocess | |
# Redirect stderr and stdout of a subprocess to the python ones | |
def exec_cmd_with_output(cmd): | |
stdoutlines = [] | |
a_process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
for line in a_process.stdout: |