[Tutor] tk Radiobutton example

paul.hermeneutic at gmail.com paul.hermeneutic at gmail.com
Sun Feb 14 18:42:50 EST 2016


+I am working through "Python GUI Programming Cookbook" by Burkhard Meier.
https://www.packtpub.com/application-development/python-gui-programming-cookbook

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)


More information about the Tutor mailing list