code: def get_output(command):
      
      p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
      p.stdin.close()
      p.stderr.close()
      line=p.stdout.readline().strip()
      p.wait()
      if type(line).__name__ == "bytes":
          line = str(line, encoding="utf-8")
      return line, p.returncode
docs: Returns the output of a command returning a single line of output.