0

I am fairly new to pygame and was trying to create a program that would open up a window and then close it when a user clicked the exit button.

import pygame
pygame.init()
screen = pygame.display.set_mode([640, 480])
running  = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
pygame.quit()

After I run this program, the window opens up and I click the button to close the window. Then, I get the spinning wheel of death and my program and pygame go unresponsive. I am using a Mac running 10.11.5. Thanks!

0 Answers0