Re: [Tutor] Globals as variables in a tkinter widget

2010-12-10 Thread Alan Gauld
wrote This code produces a good run. Not sure what you mean by that. What is "a good run"? from tkinter import * root = Tk() class Application(Frame): global sv, Ptype, PtypeI, sel_rate_label, label This is bizarre. Globals are generally considered evil and to be avoided if possible.

[Tutor] Globals as variables in a tkinter widget

2010-12-10 Thread echowit
This code produces a good run. from tkinter import * root = Tk() class Application(Frame): global sv, Ptype, PtypeI, sel_rate_label, label label = Label(root) Ptype = 999 PtypeI = IntVar() W = 5 Y = 4 def sel(self): global W global Y Ptype = P