Skip to main content
Engineering LibreTexts

5.13: IDLE and Terminating Pygame Programs

  • Page ID
    14504
  • def terminate():
        pygame.quit()
        sys.exit()
    

    This is a function that we can call that calls both the pygame.quit() and sys.exit() functions. This is a bit of syntactic sugar, so that instead of remembering to make both of these calls, there is just a single function we can call instead.