import pygame, sys
from pygame.locals import *
pygame.init()
window = pygame.display.set_mode((400, 300))
my_image = pygame.image.load(r'/Users/Humberto/documents/python/games/alien')
posX, posY = 200, 150
window.blit(my_image, (posX, PosY))
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
我试图加载在同一个文件夹中的图像,它将返回一个错误消息pygame.error.错误:无法打开/Users/Humberto/documents/python/games/alien我尝试过编写.png扩展名,也使用/和//编写整个路径,还尝试了原始字符串。我怎样才能解决这个问题?在
目前没有回答
相关问题 更多 >
编程相关推荐