Skip to content

Instantly share code, notes, and snippets.

@jerryalfs
Created January 31, 2016 09:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerryalfs/3ddb8e294a74368fcac6 to your computer and use it in GitHub Desktop.
Save jerryalfs/3ddb8e294a74368fcac6 to your computer and use it in GitHub Desktop.
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