The code is meant to quickly exit pygame by tapping escape.
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN():
if event.key == pygame.K_ESCAPE:
running = False
pygame.quit()
sys.exit()
This code errors with this:
Message File Name Line Position
Traceback
<module> G:\Code\JonSocket\keyboard.py 19
TypeError: 'int' object is not callable
Very similar code works when,
event.type == pygame.QUIT
Is there a difference between pygame.QUIT + pygame.KEYDOWN?
Thanks.
x = 1; x(). Make sure to listen to the error messages - this is too localized and very duplicated.pygame.quitis a function butpygame.QUITis an int. You can verify this withprint(type(pygame.QUIT))