code: def __handle_events(self):
          
          events = pygame.event.get()
          for event in events:
              if event.type == pygame.QUIT:
                  self.exit()
docs: This is the place to put all event handeling.