<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>&nbsp;</div>


<div>from tkinter import *<br>
root = Tk()<br>
class Application(Frame):<br>
&nbsp;&nbsp;&nbsp; global sv, Ptype, PtypeI, sel_rate_label, label<br>
&nbsp;&nbsp;&nbsp; label = Label(root)<br>
&nbsp;&nbsp;&nbsp; Ptype = 999<br>
&nbsp;&nbsp;&nbsp; PtypeI = IntVar()<br>
&nbsp;&nbsp;&nbsp; W = 5<br>
&nbsp;&nbsp;&nbsp; Y = 4<br>
&nbsp;&nbsp;&nbsp; def sel(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global W<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global Y<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ptype = PtypeI.get()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Ptype &lt;= 333: print('\nResulting Values:', PtypeI.get(),Ptype)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else: print('Ptype Failure:',PtypeI.get())</div>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print('Ptype Completed',Ptype,'\n')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; V = 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X = 3<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Z = X * 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; W = X + 6<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Y = V ** 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U = W * Y<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print("V: ",V," X: ",X," Z: ",Z," W: ",W," Y: ",Y," U: ",U,'\n')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; def __init__(self,master=None):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Frame.__init__(self)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.pack()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sel_rate_label = Label(self)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sel_rate_label.config(text = '\nSelect Goats Personality Type',)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sel_rate_label.pack(anchor=N)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MODES = [<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("1 Below Average", 000), ("2 Average", 111),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("3 Above Average", 222), ("4 Super Star", 333),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for text, mode in MODES:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b = Radiobutton(self, text=text,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variable=PtypeI, value=mode, command = self.sel)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.pack(anchor=W)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label.pack()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</div>


<div>&gt;&gt;&gt; ================================ RESTART ================================<br>
&gt;&gt;&gt; </div>


<div>Resulting Value: 333 333 </div>


<div>Ptype Completed 333 </div>


<div>V:&nbsp; 2&nbsp; X:&nbsp; 3&nbsp; Z:&nbsp; 6&nbsp; W:&nbsp; 9&nbsp; Y:&nbsp; 4&nbsp; U:&nbsp; 36 </div>


<div>&gt;&gt;&gt; </div>


<div>&nbsp;</div>


<div><EM><STRONG><FONT color=red>Assigning U prior to recalculating W &amp; Y:</FONT></STRONG></EM></div>


<div>&nbsp;</div>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U = W * Y<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; V = 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X = 3<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Z = X * 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; W = X + 6<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Y = V ** 2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print("V: ",V," X: ",X," Z: ",Z," W: ",W," Y: ",Y," U: ",U,'\n')</div>


<div>&nbsp;</div>


<div><FONT color=red><EM><STRONG>Produces:<br>
</STRONG></EM></FONT></div>


<div>&gt;&gt;&gt; ================================ RESTART ================================<br>
&gt;&gt;&gt; </div>


<div>Resulting Values: 333 333<br>
Ptype Completed 333 </div>


<div>Exception in Tkinter callback<br>
Traceback (most recent call last):<br>
&nbsp; File "C:\Python31\lib\tkinter\__init__.py", line 1399, in __call__<br>
&nbsp;&nbsp;&nbsp; return self.func(*args)<br>
&nbsp; File "C:\Larry\FCGCF\GPDB\Dev\EX_OK.py", line 18, in sel<br>
&nbsp;&nbsp;&nbsp; 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>&nbsp;</div>


<div>My Question is: Anybody know of some good on-line documentation about using GUIs to do more than say 'Hello World'?&nbsp;</div>


<div>&nbsp;</div>


<div>Thanx in advance,</div>


<div>&nbsp;</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>