Pygame错误:AttributeError:模块“Pygame”没有属性“load”

2024-04-28 23:22:55 发布

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

我目前正在用pygame开发一个pygame游戏,在python3.7.2中。 当我运行一个奇怪的程序时: 这是完整的回溯:

hello from the 1st lign of this code :D
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "C:\Users\-------\----------\---------\WIP\newfile.py", line 69, in <module>
    Window('load')
  File "C:\Users\-------\----------\---------\WIP\newfile.py", line 52, in Window
    bg32 = pygame.load('sprites/bg32.png').convert_alpha()
AttributeError: module 'pygame' has no attribute 'load'

这真的很奇怪,因为'load'函数是pygame的一个非常基本和重要的功能。。。 所以这是我的代码(完整),我还是不明白这里出了什么问题:

^{pr2}$

所以我希望有人能发现问题:D 感谢任何愿意帮助我的人!在


Tags: theinfrompy游戏lineloadwindow