<font color='black' size='2' face='arial'>
<div style="FONT-FAMILY: arial,helvetica; COLOR: black; FONT-SIZE: 10pt">
<div id=AOLMsgPart_1_b8d2cd45-ad8d-4fa8-beac-ba8579135716><FONT color=black size=2 face=arial>
<div><STRONG><EM><FONT color=red>This code produces a good run.</FONT></EM></STRONG></div>
<div> </div>
<div>from tkinter import *<br>
root = Tk()<br>
class Application(Frame):<br>
global sv, Ptype, PtypeI, sel_rate_label, label<br>
label = Label(root)<br>
Ptype = 999<br>
PtypeI = IntVar()<br>
W = 5<br>
Y = 4<br>
def sel(self):<br>
global W<br>
global Y<br>
Ptype = PtypeI.get()<br>
if Ptype <= 333: print('\nResulting Values:', PtypeI.get(),Ptype)<br>
else: print('Ptype Failure:',PtypeI.get())</div>
<div> print('Ptype Completed',Ptype,'\n')<br>
V = 2<br>
X = 3<br>
Z = X * 2<br>
W = X + 6<br>
Y = V ** 2<br>
U = W * Y<br>
print("V: ",V," X: ",X," Z: ",Z," W: ",W," Y: ",Y," U: ",U,'\n')<br>
return<br>
<br>
def __init__(self,master=None):<br>
Frame.__init__(self)<br>
self.pack()<br>
sel_rate_label = Label(self)<br>
sel_rate_label.config(text = '\nSelect Goats Personality Type',)<br>
sel_rate_label.pack(anchor=N)<br>
MODES = [<br>
("1 Below Average", 000), ("2 Average", 111),<br>
("3 Above Average", 222), ("4 Super Star", 333),<br>
]<br>
for text, mode in MODES:<br>
b = Radiobutton(self, text=text,<br>
variable=PtypeI, value=mode, command = self.sel)<br>
b.pack(anchor=W)<br>
label.pack()<br>
return</div>
<div>app = Application(master=root) <br>
app.mainloop()<br>
#root.destroy()</div>
<div><br>
<STRONG><EM><FONT color=red>This is the IDLE output.</FONT></EM></STRONG></div>
<div> </div>
<div>>>> ================================ RESTART ================================<br>
>>> </div>
<div>Resulting Value: 333 333 </div>
<div>Ptype Completed 333 </div>
<div>V: 2 X: 3 Z: 6 W: 9 Y: 4 U: 36 </div>
<div>>>> </div>
<div> </div>
<div><EM><STRONG><FONT color=red>Assigning U prior to recalculating W & Y:</FONT></STRONG></EM></div>
<div> </div>
<div> U = W * Y<br>
V = 2<br>
X = 3<br>
Z = X * 2<br>
W = X + 6<br>
Y = V ** 2<br>
print("V: ",V," X: ",X," Z: ",Z," W: ",W," Y: ",Y," U: ",U,'\n')</div>
<div> </div>
<div><FONT color=red><EM><STRONG>Produces:<br>
</STRONG></EM></FONT></div>
<div>>>> ================================ RESTART ================================<br>
>>> </div>
<div>Resulting Values: 333 333<br>
Ptype Completed 333 </div>
<div>Exception in Tkinter callback<br>
Traceback (most recent call last):<br>
File "C:\Python31\lib\tkinter\__init__.py", line 1399, in __call__<br>
return self.func(*args)<br>
File "C:\Larry\FCGCF\GPDB\Dev\EX_OK.py", line 18, in sel<br>
U = W * Y<br>
TypeError: can't multiply sequence by non-int of type 'str'<br>
<br>
My goal is to I learnto use a global variable as an argument inside a widget function,</div>
<div> </div>
<div>My Question is: Anybody know of some good on-line documentation about using GUIs to do more than say 'Hello World'? </div>
<div> </div>
<div>Thanx in advance,</div>
<div> </div>
<div>Larry Rochester</div>
<div>AKA <A href="mailto:echowit@aol.com">echowit@aol.com</A></div>
<div style="CLEAR: both"></div>
</FONT></div>
<!-- end of AOLMsgPart_1_b8d2cd45-ad8d-4fa8-beac-ba8579135716 --></div>
</font>