img = pygame.image.load('Documents/pythonPenrose.png').convert_alpha()
imgx = 10
imgy = 10
gameDisplay = pygame.display.set_mode((displayWidth,displayHeight))
pygame.display.set_caption('The Penrose ')
pygame.display.update()
gameExit = False
while not gameExit:
for event in pygame.event.get():
print event
gameDisplay.fill(cyan)
gameDisplay.blit(img, (imgx, imgy))
pygame.draw.rect(gameDisplay, red, (0,0,800,100))
pygame.draw.rect(gameDisplay, dark_red, (0,100,800,7))
答案 0 :(得分:0)
您提供的文件名对我来说似乎很奇怪:
"Documents/pythonPenrose).png"
不需要:
"Documents/pythonPenrose.png" #whithout the )
甚至
"Documents/python/Penrose.png"
您的错误表示您在加载* .jpg时遇到问题,尽管您提供了*,png也表示您的文件名存在问题。