为什么我的pygame程序不能显示我的imag

2024-04-20 09:21:42 发布

您现在位置:Python中文网/ 问答频道 /正文

import pygame
from pygame.locals import *
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height),0,32)
player=pygame.image.load("cat.png")

while True:
    screen.fill(0,255,0)
    screen.blit(player,(100,100))
    pygame.display.flip
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            pygame.quit
            exit(0)

这拒绝显示我的猫的照片,并没有错误的外壳。如果我犯了一个愚蠢的错误,我很抱歉,但是我对这个网站和python都很陌生。你知道吗


Tags: fromimageimporteventinitmode错误display