I was programming pygame in Mac. Then, there was a problem. I wrote the code like below, but pygame.display.update() doesn't work. It should update and wait 3 seconds, but it wait 3 seconds first, and it updates after pygame.quit(). Can anyone tell me how to solve this problem?
this doesn't work:
import pygame
import sys
pygame.init()
win = pygame.display.set_mode((500, 500))
pygame.display.set_caption("hello")
font = pygame.font.SysFont("comicsans", 100)
text = font.render("hello", 1, (255, 255, 255))
win.blit(text, (200, 200))
pygame.display.update()
pygame.time.delay(3000)
pygame.quit()
sys.exit(0)
this works normaly:
import pygame
import sys
pygame.init()
win = pygame.display.set_mode((500, 500))
pygame.display.set_caption("hello")
font = pygame.font.SysFont("comicsans", 100)
text = font.render("hello", 1, (255, 255, 255))
win.blit(text, (200, 200))
pygame.display.update()
pygame.quit()
pygame.time.delay(3000)
sys.exit(0)
OS: Mac
Python Version 3.8.3
Pygame Version 1.9.6
Editor: Jupyter Notebook