I am trying to create a window and then close the window. Everything runs smoothly until I click the red X. When I click it, the window doesn't close and all that happens is that the colourful red beach ball thing shows up whenever I hover my mouse over the Pygame window and the window just does not respond.
It seems like the pygame.quit()
or pygame.display.quit()
functions do not work for some reason.
import pygame
pygame.init()
Window=pygame.display.set_mode((250, 250))
run=True
while run:
for event in pygame.event.get():
if event.type==pygame.QUIT:
run=False
pygame.quit()
pygame.display.quit()