import pygame import sys pygame.init() display = pygame.display.set_mode((400, 300)) while True: mouse_pos = pygame.mouse.get_pos() for event in pygame.event.get() : if event.type == pygame.Quit: pygame.quit() sys.exit() pygame.display.update()