[Tutor] Traffic Light

Alan Gauld alan.gauld at btinternet.com
Sat Jan 19 22:02:40 CET 2013


On 19/01/13 20:31, anthonym wrote:

>          rbRed = Radiobutton(frame1, text = "Red", bg = "red",
>                  variable = self.v2,
>                  value = 1,
>                  command = self.processRadiobutton)

Here you assign your method to the button

>          # Add Radio Button process below once I figure that out

But you haven't defined it, it does not exist.
So python complains.

You need to define something, even just a pass:


          def processRadioButton(self): pass


> 16, in __init__
>      command = self.processRadiobutton)
> AttributeError: 'Trafficlight' object has no attribute 'processRadiobutton'


HTH

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list