def render(self):
    self.clear()
self.button.draw()
self.flip()

def run(self):
    while self.alive == 1:
        self.render()
event = self.dispatch_events()
x = main()
x.run()
Curses alternative for windows