5687Fermer5689
RHJPPLe 20/04/2015 à 00:23
La commande est réexécutée, les sorties sont donc lisibles :def get_command(settings, args): """Creates command from `args` and executes it.""" script = ' '.join(args[1:]) result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE, env=dict(os.environ, LANG='C')) if wait_output(settings, result): return Command(script, result.stdout.read().decode('utf-8'), result.stderr.read().decode('utf-8')) (...) def main(): user_dir = setup_user_dir() settings = get_settings(user_dir) command = get_command(settings, sys.argv) (...)