[Tutor] trouble using tkinter CheckButton

Chris Roy-Smith chris_roysmith at internode.on.net
Tue Jan 16 14:47:55 EST 2018


On 16/01/18 22:35, Alan Gauld via Tutor wrote:
> On 16/01/18 04:37, Chris Roy-Smith wrote:
>
>>     File "./debugString.py", line 7, in SetFin
>>       SetStatus[x] = var.get(x)
>> AttributeError: 'list' object has no attribute 'get'
>> var=[IntVar() for x in range(8)]
> Here you create a list of IntVar objects.
> The list has no get() method - just as the error message says.
> You need to access the individual IntVar for your widget.
>
> I suspect you want
>
>    SetStatus[x] = var[x].get()
>
Yes, Thank you, that was the problem. other problems in my code, after 
correcting the get() were easy to sort out.

Regards, Chris Roy-Smith



More information about the Tutor mailing list