This is extremely annoying and I don't know why it's happening. Here's the code:
import pygame
from sys import exit
def createWin(x, y):
winCreate = True
while winCreate:
win = pygame.display.set_mode((x, y))
if event.type == pygame.QUIT:
pygame.quit()
exit()
createWin(1000, 1000)
I get this error:
NameError: name 'event' is not defined
eventis nowhere defined. I think you should look at the tutorial again and find where the event variable is defined. I am sure pygame has some good tutorialseventisn't defined. It's not a primitive in python. I'm assuming that you are looking at a tutorial somewhere whereeventis being used. Check that tutorial for where they defineevent, i.e.event = ..., orfrom X import event