我有,我有一個方法的Python類我想運行多個線程線程錯誤 - 參數過多
class OutageTool:
def main(self):
outages = [{
'var1' : 1,
'var2' : 2,
},
{
'var1' : 3,
'var2' : 4,
}]
for outage in outages:
t = threading.Thread(target=self.outage_thread, args=(outage))
t.start()
def outage_thread(self, outage):
"""
some code here
"""
的當我運行這段代碼,我發現了錯誤
TypeError: outage_thread() takes exactly 2 arguments (3 given)
我是python的新手,非常感謝這裏發生的一切。
Ç