import pygame pygame.init() W, H = 900, 500 WIN = pygame.display.set_mode((W, H)) run = True while run: for event in pygame.event.get(): if event.type == pygame.QUIT: run = False pygame.quit()