调用 DeleteButton 函数时出现错误“元组索引超出范围”。我正在尝试一次从列表中删除多个对象。有人能告诉我我的逻辑有什么问题吗?
def DeleteButton(self,event):
sel = self.task_list.GetSelections()
length = len(sel)
for item in range (0, length):
index = sel[item]
self.task_list.Delete(index)
sel = self.task_list.GetSelections()
length = len(sel)