这段简单的代码在几秒钟后(大约5)崩溃(窗口没有响应)。几秒后Pygame窗口没有响应
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 24)
#clock = pygame.time.Clock()
#font = pygame.font.Font(None, 32)
cycles = 0
while True:
screen.fill(0)
# text = font.render('Cycles : %d' % cycles, True, (255, 255, 255))
# screen.blit(text, (100, 100))
cycles += 1
pygame.display.update()
如果我去掉注释行,我可以清楚地看到该程序47和50的
我使用Python 2.7和1.9.2 pygame的,视窗8之间显示值时,失控的(64位)和Eclipse + PyDev。
我只能说:它适用于Python 2.7,PyGame 1.9.2,Linux Mint(32位),Geany。你从Eclipse或终端运行它吗? – furas