【发布时间】:2013-04-24 22:34:24
【问题描述】:
尝试使用 Python 中的游戏引擎进行文本冒险。无论如何,我不断收到此错误消息。 TypeError: module.__init__() takes at most 2 arguments (3 given)
这是我的代码:
from engine import game
from engine import event
from engine import place
class TextAdventureGame(game):
def __init__(self):
super(TextAdventureGame, self).__init__()
self.introduction = ('''Welcome to Can You Escape text adventure game.
You wake up in a dark room and you have no idea where you are.''')
为什么会出现这个错误?
class TextAdventureGame(game):
TypeError: module.__init__() takes at most 2 arguments (3 given)
【问题讨论】:
-
你是如何实例化你的类的?
-
考虑将问题的标题更改为反映您具体问题的内容。
-
1:这是你的全部代码吗? 2:如果你删除
super(TextAdventureGame, self).__init__(),你会得到同样的错误吗?