def write(self, output='<STR_LIT>', flush=True, position=<NUM_LIT:0>):
if self.enabled:<EOL><INDENT>term = self.term<EOL>stream = self.stream<EOL>try:<EOL><INDENT>term.move_to(<NUM_LIT:0>, term.height - position)<EOL>if NEEDS_UNICODE_HELP:  <EOL><INDENT>encoding = stream.encoding or '<STR_LIT>'<EOL>stream.write(('<STR_LIT:\r>' + term.clear_eol + output).encode(encoding))<EOL><DEDENT>else:  <EOL><INDENT>stream.write('<STR_LIT:\r>' + term.clear_eol + output)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self._set_scroll_area()<EOL>if flush:<EOL><INDENT>stream.flush()<EOL><DEDENT><DEDENT><DEDENT>
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