(args, encoding: str = "utf-8")
return (stdout or ""), returncode
Returns the output of a command returning a single line of output, and
    the exit code of the command.
Returns the output of a command returning a single line of output, and
    the exit code of the command.
Returns the output of a command returning a single line of output and the exit code of the command .
def get_output(args, encoding: str = "utf-8") -> Tuple[str, int]:
    """Returns the output of a command returning a single line of output, and
    the exit code of the command.
    """
    PIPE = subprocess.PIPE
    try:
        p = subprocess.Popen(args, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        stdout, stderr = p.communicate()
        returncode = p.returncode
    except OSError:
        stdout, stderr = None, None
        returncode = 77
    if isinstance(stdout, bytes):
        stdout = str(stdout, encoding=encoding)
    if isinstance(stderr, bytes):
        stderr = str(stderr, encoding=encoding)
    return (stdout or ""), returncode
def get_output ( args , encoding : str = "utf-8" ) -> Tuple [ str , int ] : PIPE = subprocess . PIPE try : p = subprocess . Popen ( args , shell = False , stdin = PIPE , stdout = PIPE , stderr = PIPE ) stdout , stderr = p . communicate ( ) returncode = p . returncode except OSError : stdout , stderr = None , None returncode = 77 if isinstance ( stdout , bytes ) : stdout = str ( stdout , encoding = encoding ) if isinstance ( stderr , bytes ) : stderr = str ( stderr , encoding = encoding ) return ( stdout or "" ) , returncode