I'm learning Tkinter and have two questions.
[1st one answered in the comment section]
1 - Why do the items in the dictionary are not printed in the correct order? If you delete the "grid" part from the Button, you may see that they are not ordered.
2 - Why the button is not shown? I want to make a button just below the checkboxes, which will print out "1" for each clicked checkboxes.
This link was my reference.
Below is my code:
from Tkinter import *
master = Tk()
def read():
print dict[mini].get()
dict = {"first": 0, "second": 0, "third": 0}
for mini in dict:
dict[mini] = Variable()
l = Checkbutton(master, text=mini, variable=dict[mini])
l.grid(sticky=W, pady=4)
l.pack()
Button(master, text='Show', command=read).grid(row=len(dict) + 1, sticky=W, pady=4)
master.mainloop()
Edit: Spelling