0

Hi,
This is my code:

def update_cost(self,newcost):
        if self.view.curselection() == ():
            tkMessageBox.showerror(None,'No Item Selected')
        else:
            for key, value in self.products.mydict.iteritems():
                check1=self.products.mydict[self.select_id()].get_depend()
                if check1==[]:
                    v=self.products.get_item(self.select_id())
                    v.set_cost(int(newcost))  
                    self.write()
            else:
                tkMessageBox.showerror(None,'Cannot Update Cost Of Compound Item')

def select_id(self):
        index = int(self.view.curselection()[0])
        item = self.view.get(index)
        return item.split()[0]

view is just a class which inherits a listbox and mydict is a dictionary in products class. I keep getting this error everytime i use update_cost:
IndexError: tuple index out of range

any suggestions?

2
Contributors
1
Reply
3
Views
4 Years
Discussion Span
Last Post by vegaseat
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.