<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append_to_history(self, filename, command, go_to_eof):
 """ Append an entry to history filename. Args: filename (str):
 file to be updated in a new tab. command (str):
 line to be added. go_to_eof (bool):
 scroll to the end of file. """

        if not is_text_string(filename): # filename is a QString
            filename = to_text_string(filename.toUtf8(), 'utf-8')
        command = to_text_string(command)
        index = self.filenames.index(filename)
        self.editors[index].append(command)
        if go_to_eof:
            self.editors[index].set_cursor_position('eof')
        self.tabwidget.setCurrentIndex(index)