Pygame programs hanging on exit

前端 未结 5 1504
野趣味
野趣味 2021-01-02 07:11

I\'m tinkering around with pygame right now, and it seems like all the little programs that I make with it hang when I try to close them.

Take the following code, fo

5条回答
  •  甜味超标
    2021-01-02 07:26

    If you are running it from IDLE, then you are missing pygame.quit().

    This is caused by the IDLE python interpreter, which seems to keep the references around somehow. Make sure, you invoke pygame.quit() on exiting your application or game.

    See: In IDLE why does the Pygame window not close correctly?

    And also: Pygame Documentation - pygame.quit()

提交回复
热议问题