I have code as follows:
class insert_data(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
# create calender dropdown menu
cal_input = DateEntry(
self,
width = 12,
borderwidth = 2,
year = 2020,
background = 'blue'
)
cal_input.grid(row = 1, column = 1, padx = 10, pady = 5, sticky = 'ew')
I am trying to get the value from cal_input
(date entry widget) and print it on my terminal. However I don't have any idea how to do it. I keep getting errors. I have tried to call class object however I still cannot get the value from the date entry widget. Can anyone give me advice? Any help will be appreciated.
Note: Here is my full code = https://pastebin.com/cYYtBx7b
Create a variable
entry = StringVar()
text=entry.get()
this will store your entry in textinside
cal_input
usetextvariable=entry
Modified code is given below