I just want to know the difference between .quit and .QUIT in pygame. I’ve tested both but I continue to not understand how they work.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
QUIT is the enumerator constant for an event type (see event module). The quit event occurs when the pygame window is closed:
for event in pygame.event.get():
if event.type == pygame.QUIT:
# [...]
quit() is a function which uninitialize all pygame modules. This function should be called at the end of the applicaiition:
# initialize all imported pygame modules
pygame.init()
# application loop
while True:
# [...]
# uninitialize all pygame modules
pygame.quit()
Method 2
The .QUIT in pygame is used to check if you pressed the cross button on the window which is a pygame event. If you have to quit a window you should press the cross button most of the times.

Here is a example of an image for with the cross button on a window
So when you press the cross arrow button on the window it quits the window so when you press the cross button on a pygame window it is stored in a event named pygame.QUIT.
pygame.quit() uninstializez all of pygame’s modules i am not sure but after you say nthe line pygame.quit() you wont be able to use most of or all pygame function
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0