I've had people on reddit telling me that my code is OK and that it works on their end. It is just a basic code that makes a red background. They copy and pasted it, so it's the same as mine.
I've uninstalled and reinstalled pygame and restarted my computer. I have pygame 2.1.2 and python 3.9.0 on a windows 11 operating system. The pygame window has been black and "not responding", it has never responded since the beginning. If it isn't the code that is wrong, neither it is a compatibility issue, then what is the problem? Nothing seems to work.
import pygame
pygame.init()
surf_width, surf_height = 400, 300
screen = pygame.display.set_mode((surf_width, surf_height))
pygame.display.set_caption("red background")
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill("red")
pygame.display.update()
pygame.quit()