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?

Can you give us the full traceback message?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.