当我在PyCharm中运行此代码时,它不会打开窗口。python启动程序可以运行,但不能运行pygame。当我把它作为一个.py文件运行时,它工作得很好。你知道吗
import pygame
background_colour = (255,255,255)
(width, height) = (300, 200)
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Tutorial 1')
screen.fill(background_colour)
pygame.display.flip()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
目前没有回答
相关问题 更多 >
编程相关推荐