Created
January 31, 2016 09:29
How to close pygame after press x button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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