So this is the code, which draws heavily from this question:
How do I create multiple checkboxes from a list in a for loop in python tkinter.
from tkinter import *
root = Tk()
enable = {'jack': 0, 'john': 1}
def actright(x):
print(enable.get(x))
for machine in enable:
enable[machine] = Variable()
l = Checkbutton(root, text=machine, variable=enable[machine],
command= actright(machine))
l.pack(anchor = W)
root.mainloop()
I expected the output to be:
0
1
Instead the output is:
PY_VAR0
PY_VAR1
How can I get these values without the "PY_VAR" preceding the number?