我正在尝试从另一个 .py 初始化类(extraropt),但它给了我一个错误,我已经搜索过但我没有找到解决方案。
这是我调用的一个 py 的代码:
主要.py:
class GameWindow(ui.ScriptWindow):
def __init__(self, stream):
import extraop
exec 'extraop.extraropt().Show(stream)'
这是我试图调用的一个 py 的代码(仅限 init 和 del):
外部操作.py
class extraropt(ui.Window):
def __init__(self, stream):
ui.Window.__init__(self)
self.BuildWindow()
self.stream=stream
def __del__(self):
ui.Window.__del__(self)
它给出了这个错误:
Error - __init__() takes exactly 2 arguments (1 given)