1
import pygame

pygame.init()
screen = pygame.display.set_mode((800, 600))
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT(): 
            running = False

When executing this code, I get the following error:

'int' object is not callable
1
  • 1
    maybe try to look at the error, especially what column said error is on Commented Apr 30, 2021 at 5:20

1 Answer 1

1

pygame.QUIT is an int and not a function. Try removing the parentheses:

if event.type == pygame.QUIT:
    running = False
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.