Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~912 People Reached
Favorite Forums
Favorite Tags
Member Avatar for cruze098

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 …

Member Avatar for vegaseat
0
381
Member Avatar for cruze098

How can you use a class 1's method in another class 2. Class 2 does not inherit class 1.

Member Avatar for Gribouillis
0
154
Member Avatar for cruze098

Hi, this is my code: def items_string(items_list): """Convert a list of Id, number pairs into a string representation. items_string(list((str, int))) -> str """ result = [] for item_id, num in items_list: result.append("{0}:{1}".format(item_id, num)) return ','.join(result) class Compound(Item): def __init__(self,item_id,name,products,items_list): Item.__init__(self,item_id,name) self.products=products self.items_list=items_list def __repr__(self): self.items_list=items_string(self) return '{0},{1},{2}'.format(self.item_id,self.name,self.items_list) class Products: def …

Member Avatar for Gribouillis
0
377