parameters: (args, encoding="utf-8")
return_statement: return stdout, returncode
docstring: Returns the output of a command returning a single line of output.
docstring_summary: Returns the output of a command returning a single line of output.
docstring_tokens: Returns the output of a command returning a single line of output .
function: def get_output(args, encoding="utf-8"):
      """Returns the output of a command returning a single line of output."""
      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 encoding and type(stdout).__name__ == "bytes":
          stdout = str(stdout, encoding=encoding)
      if encoding and type(stderr).__name__ == "bytes":
          stderr = str(stderr, encoding=encoding)
      return stdout, returncode
function_tokens: def get_output ( args , encoding = "utf-8" ) : 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 encoding and type ( stdout ) . __name__ == "bytes" : stdout = str ( stdout , encoding = encoding ) if encoding and type ( stderr ) . __name__ == "bytes" : stderr = str ( stderr , encoding = encoding ) return stdout , returncode