from tkinter import *
root = Tk()
users = ['Anne', 'Bea', 'Chris', 'Bob', 'Helen']
selected_users=[]
for x in range(len(users)):
l = Checkbutton(root, text=users[x][0], variable=users[x])
l.pack(anchor = 'w')
root.mainloop()
I have this sample code, I need to make multiple selections in that users list, after I hit OK, it stores checked value into another list named selected_users for later use.
For example, when I run this code, a checkbox window pops out, and I tick Anne,Bob, click OK. selected_users is now ['Anne','Bob']. And Window disappears