if event.key == pygame.K_SPACE: #what ever you want to run
state = pygame.key.get_pressed() if state[pygame.K_SPACE]: