Skip to content

Instantly share code, notes, and snippets.

@jerryalfs
Created January 31, 2016 09:29
How to close pygame after press x button
from sys import exit
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()
#PUT THE FOLLOWING CODE AT THE END OF PYGAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment