I am trying to make a loop that populates 9 radio buttons, each with 4 options, and placed in a grid. The following code words, however, I can select more than one option for each question. My understanding is that for each variable I should only be able to select one. Is the loop constructed incorrectly?
MODES = [
('dep_name1', 'dep_but1', 2, "Not at all", 'op1'),
('dep_name2', 'dep_but2', 3, "Several days", 'op2'),
('dep_name3', 'dep_but3', 4, "More than half the days", 'op3'),
('dep_name4', 'dep_but4', 5, "Nearly everyday", 'op4'),
]
for r in range (2, 11):
for dep_name, button, c, text, b_val in MODES:
button = tk.StringVar()
# button.set("L")
dep_name = tk.Radiobutton(window, text=text, variable=button, indicatoron=0, value=b_val).grid(row=r, column=c, sticky='e')
window.columnconfigure("all", weight=1)
window.rowconfigure("all", weight=1)
window.mainloop()