[Tutor] tk Radiobutton example

Alan Gauld alan.gauld at btinternet.com
Mon Feb 15 04:50:54 EST 2016

On 14/02/16 23:42, paul.hermeneutic at gmail.com wrote:

> On page 20, the variable curRad is set to a string then to a
> Radiobutton. What is the purpose of setting curRad to a string?
> for col in range(3): # 3
>     curRad = 'rad' + str(col)
>     curRad = tk.Radiobutton(win, text=colors[col], variable=radVar,
> value=col, command=radCall)
>     curRad.grid(column=col, row=5, sticky=tk.W)

No purpose whatsoever, it looks like either a mistake or a typo.
Mostly a mistake. Is there a similar piece of code elsewhere in the book
that may have been cut n pasted and then badly edited?

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list