I am working on a simple project called restaurant management. I am trying to put the values from the entry into a dictionary. here is the code:
from tkinter import *
root=Tk()
entries = []
for i in range(3):
en = Entry(root)
en.grid(row=i+1, column=0)
entries.append(en.get())
case_list = {}
for entry in entries:
case = {'key1': entry, 'key2': entry, 'key3':entry }
case_list.update(case)
def hallo():
print(case_list)
button=Button(root,text="krijg",command=hallo).grid(row=12,column=0)
root.mainloop()
but when I print the dictionary to see the values for each keys, it gives me this output
{'key1': '', 'key2': '', 'key3': ''}