code: def write(self, output='', flush=True, position=0):
          
  
          if self.enabled:
  
              term = self.term
              stream = self.stream
  
              try:
                  term.move_to(0, term.height - position)
                  # Include \r and term call to cover most conditions
                  if NEEDS_UNICODE_HELP:  # pragma: no cover (Version dependent 2.6)
                      encoding = stream.encoding or 'UTF-8'
                      stream.write(('\r' + term.clear_eol + output).encode(encoding))
                  else:  # pragma: no cover (Version dependent >= 2.7)
                      stream.write('\r' + term.clear_eol + output)
  
              finally:
                  # Reset position and scrolling
                  self._set_scroll_area()
                  if flush:
                      stream.flush()
docs: Args:
              output(str: Output string
              flush(bool): Flush the output stream after writing
              position(int): Position relative to the bottom of the screen to write output
  
          Write to stream at a given position