def render(self):
    self.clear()
self.geodata_image.blit(0, 0, 0)
self.flip()

def on_close(self):
    self.alive = 0

def run(self):
    while self.alive:
        self.render()
event = self.dispatch_events()
sleep(1.0 / 25)
win = Window()
win.run()
Python GUI from Java