def exec_command_stdout(*command_args, **kwargs):
 encoding = kwargs.pop('encoding', None)
 kwargs['universal_newlines'] = (encoding is None)
 stdout = subprocess.check_output(command_args, **kwargs)
 return (stdout if (encoding is None) else stdout.decode(encoding))

def exec_command_stdout ( * command_args , ** kwargs ) : encoding = kwargs . pop ( 'encoding' , None ) kwargs [ 'universal_newlines' ] = ( encoding is None ) stdout = subprocess . check_output ( command_args , ** kwargs ) return ( stdout if ( encoding is None ) else stdout . decode ( encoding ) )
capture and return the standard output of the command specified by the passed positional arguments .