When I run the following program nothing appears on my screen as you can see. The only thing I can see is the pygame icon going up and down
This is the code:
import pygame
pygame.init()
window=(800,600)
screen=pygame.display.set_mode(window)
background = pygame.Surface(window)
background.fill((255,0,0))
loop=True
while loop:
screen.fill((0,0,0))
screen.blit(background, (0,0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
loop = False
pygame.quit()
pygame.display.update()
The program does nothing. I only see the python launcher icon going up and down. Maybe it is a problem with my editor? (PyCharm) or my computer(Mac)? I'm a beginner and I haven't ever run into this kind of problem.