使用pygame.display继承错误
import pygame.display.Display as display
class MainDisplay(display):
def __init__(self):
super.__init__()
# creating display
X = 500
Y = 1000
display = self.set_mode((X, Y))
以下代码给出了此类型错误:
module() takes at most 2 arguments (3 given)
这是因为pygame.display是模块不是类吗?如何解决此错误?
编辑: 这是完整的追溯
Traceback (most recent call last):
File "/Users/siyunlee/Desktop/coding/personal/games/dino game/main.py", line 4, in <module>
class MainDisplay(display):
TypeError: module() takes at most 2 arguments (3 given)
import pygame.display.Display as display
class MainDisplay(display):
def __init__(self):
super.__init__()
# creating display
X = 500
Y = 1000
display = self.set_mode((X, Y))
The following code is giving this type error:
module() takes at most 2 arguments (3 given)
Is this because pygame.display is a module not a class? How could I fix this error?
edit:
this is the full traceback
Traceback (most recent call last):
File "/Users/siyunlee/Desktop/coding/personal/games/dino game/main.py", line 4, in <module>
class MainDisplay(display):
TypeError: module() takes at most 2 arguments (3 given)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个简单的示例,说明如何制作一个窗口,我建议使用以下方式:
This is a simple example of how to make a window I recommend using this: