为什么我的 Pygame 需要永远加载窗口?

问题描述

这是我从 https://realpython.com/pygame-a-primer/获取一个非常简单的代码。即使我只是加载一个没有绘图的空白窗口,显示也需要 1 到 3 分钟。它确实有效,但显示时间应该不会太长。

# Simple pygame program

# Import and initialize the pygame library
import pygame
pygame.init()

# Set up the drawing window
screen = pygame.display.set_mode([500,500])

# Run until the user asks to quit
running = True
while running:

    # Did the user click the window close button?
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # Fill the background with white
    screen.fill((255,255,255))

    # Draw a solid blue circle in the center
    pygame.draw.circle(screen,(0,255),(250,250),75)

    # Flip the display
    pygame.display.flip()

# Done! Time to quit.
pygame.quit()

Windows 10、Python 3.8、Pygame 2.0.1、Pycharm

编辑:如果我使用 Pygame 1.9.6,它似乎工作正常,所以我想这就是我现在的解决方案。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)