【问题标题】:Trying to get pygame to load an image. It worked before, but now all of a sudden it doesn't load the game anymore试图让 pygame 加载图像。以前可以用,现在突然进不了游戏了
【发布时间】:2020-04-08 21:32:09
【问题描述】:

这是我收到的错误消息:

Traceback (most recent call last):
  File "c:/Users/Bradley Kittle/Desktop/python_class/2nd_game/platform_KING.py", line 10, in <module>
    icon = pg.image.load('crown.png')
pygame.error: Couldn't open crown.png

【问题讨论】:

  • 您是否手动检查过您的“crown.png”文件以确保它存在并且没有以某种方式损坏?

标签: python image pygame


【解决方案1】:

只需打开您的文件管理器并确保“crown.png”存在于同一路径中。如果这不能解决问题,请检查您所需的文件是否在 admin 目录中。如果是这样,请以管理员身份运行您的 IDE,或者只是将文件移动给您的用户。

谢谢:)

【讨论】:

    猜你喜欢
    • 2013-09-29
    • 2019-07-10
    • 1970-01-01
    • 2022-08-17
    • 1970-01-01
    • 1970-01-01
    • 2014-07-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多