recently I watch a youtube video learing pygame for 90 min I write the exactly code that they guide on the video
import pygame
WIDTH, HEIGHT = 900, 500
WIN = pygame.display.set_mode((WIDTH,HEIGHT))
def main() :
run = True
while run :
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
if __name__ == "__name__":
main()
but the result end up with a flash screen and the program just close it self. Come with a line
PS C:\Users\Windows 10 Pro\Desktop\textpython> & "C:/python/New folder/python.exe" "c:/Users/Windows 10 Pro/Desktop/textpython/import pygame.py" pygame 2.1.3.dev8 (SDL 2.0.22, Python 3.11.0) Hello from the pygame community. https://www.pygame.org/contribute.html PS C:\Users\Windows 10 Pro\Desktop\textpython>