process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=
    subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.cwd,
    universal_newlines=True, shell=True)
output = process.communicate()
stdout = output[0]
stderr = output[1]
print(stdout)
Get output colored text with Popen