1 2 3 4 5 6 7
import pygame def anykey(): for event in pygame.event.get(): if event.type in (pygame.MOUSEBUTTONDOWN, pygame.KEYDOWN, pygame.QUIT): return True return False