Użyłem Pygame z pythonem 2.7 wcześniej, ale ostatnio "zaktualizowałem" do Pythona 3.2. Pobrałem i zainstalowałem najnowszą wersję Pygame, o której mówi się, że działa z tą wersją Pythona. Mam jednak dość frustrujący błąd na tym, co powinno być prostym blokiem kodu. Kod jest:Błąd Pygame: System wideo nie został zainicjowany
import pygame, random
title = "Hello!"
width = 640
height = 400
pygame.init()
screen = pygame.display.set_mode((width, height))
running = True
clock = pygame.time.Clock()
pygame.display.set_caption(title)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.quit():
running = False
else:
print(event.type)
clock.tick(240)
pygame.quit()
I za każdym razem uruchomić go uzyskać:
17
1
4
Traceback (most recent call last):
File "C:/Users/David/Desktop/hjdfhksdf.py", line 15, in <module>
for event in pygame.event.get():
pygame.error: video system not initialized
Dlaczego otrzymuję ten błąd?