Closing Pygame Window

前端 未结 8 707
不知归路
不知归路 2020-12-31 03:24

I just spent a fair amount of time finding a 64-bit installation of pygame to use with python 3.3, (here) and now am trying to make a window. However, although the window op

8条回答
  •  伪装坚强ぢ
    2020-12-31 03:45

    This was the final code that worked for me on OSX whilst keeping the kernel alive on Jupyter. EDIT - it does still crash the kernel sometimes :-(

    running = True
    while running:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
    pygame.display.quit()
    pygame.quit()
    exit()
    

    Also needed to downgrade ipython to get rid of some magic alias warning messages using:

    conda install ipython=7.2.0
    

    apparently that issue is due to be fixed in ipython 7.6.0

提交回复
热议问题