这段都是按书上输入的
不知道哪里出错
python AttributeError: module 'pygame' has no attribute 'display'_XIAXIAgo的博客-CSDN博客 原问题网址:https://stackoverflow.com/questions/39840580/python-attributeerror-module-pygame-has-no-attribute-display问题:当一个小哥试图用python中的pygame创建一个窗口时出现了RT问题: >>> import pygame>>>... https://blog.csdn.net/qq_20746945/article/details/80415737
解决AttributeError: module 'pygame' has no attribute 'init'_GRHSXY的博客-CSDN博客 原文链接附加链接运行python文件出现 has no attribute ‘init’ 这个情况import sysimport pygamedef run_game(): #初始化游戏并创建一个屏幕对象 pygame.init() screen = pygame.display.set_mode((1200,800)) pygame.display.... https://blog.csdn.net/weixin_43798960/article/details/104156858
应该是set_mode()
而不是set.mode
吧
这里是设置界面宽高, 方法名使用错误, set_mode是方法名