1
I’m learning to use Pygame functions, but I got caught up in this problem. I created a window with Pygame, and then I made this code so when I click the exit button the window closes.
Code
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
break
print(event)
# Atualizando a tela
pygame.display.update()
pygame.quit()
I can’t understand why it doesn’t work, the program during execution shows no error, but when I click the close button, nothing happens.