code: def main(self):
          
          self.loop = urwid.MainLoop(self.top, self.palettes[self.palette_names[0]], screen=self.tui,
                                     handle_mouse=False, input_filter=self.handle_keys,
                                     unhandled_input=self.unhandled)
          self.loop.run()
docs: Urwid main event loop