Reputation: 13
When I run pygame the window opens for a fraction of a second and then immediately closes. I followed multiple tutorials and followed them word for word but the problem still continues.
import pygame
pygame.init()
(width, height) = (300, 300)
window = pygame.display.set_mode((width,height))
run = True
while run:
window.fill(255,255,200)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
The window doesn't fill either so it feels like the while loop never runs in the first place.
Upvotes: 1
Views: 45