def save_position(self):
        """
        save cursor and scroll position
        """
        # save text cursor position:
        self.old_text_pos = self.index(tkinter.INSERT)
        # save scroll position:
        self.old_first, self.old_last = self.yview()
def save_position ( self ) : self . old_text_pos = self . index ( tkinter . INSERT ) self . old_first , self . old_last = self . yview ( )
save cursor and scroll position