Hi, so I'm having a bit of trouble exiting the Pygame window I created.
I'm pretty new to python so I assumed this would be an issue Here's the code
I'm pretty new to python so I assumed this would be an issue Here's the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import pygame pygame.init() screen = pygame.display.set_mode([ 500 , 500 ]) running = True while running: for event in pygame.event.get(): if event. type = = pygame.QUIT: running = False screen.fill(( 255 , 255 , 255 )) pygame.draw.circle(screen, ( 0 , 0 , 255 ), ( 250 , 250 ), 75 ) pygame.display.flip() while 1 : for event in pygame.event.get(): if event. type = = pygame.QUIT: pygame.display.quit(), sys.exit() |
Larz60+ write Dec-08-2020, 08:47 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
I also took the liberty to reformat your code
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
I also took the liberty to reformat your code