class App(object):

    def __init__(self):
        self.root = tki.Tk()
self.txt = ScrolledText(self.root, undo=True)
self.txt['font'] = 'consolas', '12'
self.txt.pack(expand=True, fill='both')
app = App()
app.root.mainloop()
How to attach a Scrollbar to a Text widget?