import subprocess import sys def get_from_command(command): ret = subprocess.check_output(command).decode(sys.stdout.encoding) return ret