def fight(self): v={} vi1, vi2, v = simplerpg.testFight(player, bozo, 100) print "result: ", vi1, vi2 self.v1.set(str(vi1)) self.v2.set(str(vi2)) #print app.label4.text #self.label4=Tkinter.Label(master, text=self.victorys1.get()).grid(row=1, column=0) # self.label4.configure(text=self.victorys1.get()) #geht net, none type object has no configure print self.v1.get() # get and set work fine, but how can i force an update of the label field?
def fight(self): v = {} vi1, vi2, v = simplerpg.testFight(player, bozo, 100) print "result: ", vi1, vi2 self.v1.set(str(vi1)) self.v2.set(str(vi2)) #print app.label4.text #self.label4=Tkinter.Label(master, text=self.victorys1.get()).grid(row=1, column=0) # self.label4.configure(text=self.victorys1.get()) #geht net, none type object has no configure print self.v1.get( ) # get and set work fine, but how can i force an update of the label field?
def fight(self): """calculates a number of fights and print the results""" vi1, vi2, v = simplerpg.testFight(player, bozo, int(self.v4.get())) # self.v4 is number of battles self.v1.set(str(vi1)) self.v2.set(str(vi2)) textrounds = "" textleftwins = "" textrightwins = "" texttotal = "" for x in v.keys(): # create result table # right align number with 8 whitespaces and a line ending textrounds += "{:>8}".format("%i :\n" % x) textleftwins += "{:>8}".format("%i \n" % v[x][0]) textrightwins += "{:>8}".format("%i \n" % v[x][1]) texttotal += "{:>8}".format("%i \n" % v[x][2]) self.vrounds.set(textrounds) self.vleftwins.set(textleftwins) self.vrightwins.set(textrightwins) self.vtotal.set(texttotal)
def fight(self): """calculates a number of fights and print the results""" vi1, vi2, v = simplerpg.testFight(player, bozo, int( self.v4.get())) # self.v4 is number of battles self.v1.set(str(vi1)) self.v2.set(str(vi2)) textrounds = "" textleftwins = "" textrightwins = "" texttotal = "" for x in v.keys(): # create result table # right align number with 8 whitespaces and a line ending textrounds += "{:>8}".format("%i :\n" % x) textleftwins += "{:>8}".format("%i \n" % v[x][0]) textrightwins += "{:>8}".format("%i \n" % v[x][1]) texttotal += "{:>8}".format("%i \n" % v[x][2]) self.vrounds.set(textrounds) self.vleftwins.set(textleftwins) self.vrightwins.set(textrightwins) self.vtotal.set(texttotal)