Created
January 31, 2016 09:29
-
-
Save jerryalfs/3ddb8e294a74368fcac6 to your computer and use it in GitHub Desktop.
How to close pygame after press x button
This file contains hidden or 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