title: Tkinter Error: "_tkinter.TclError: invalid command name ".!frame.!entry" PYTHON
body: <p>I get this error when I insert a value in the textbox.</p>
  
  <p>I want to insert the date in the textbox when selecting it.</p>
  
  <p>Error: <strong>_tkinter.TclError: invalid command name ".!frame.!entry"</strong></p>
  
  <p>This is my code:</p>
  
  <p><strong>main.py</strong></p>
  
  <pre><code>from calenderUI import *
  from tkinter import *
  
  
  def Dateselected():
  
   dateSelected=tkCalender()
  
   return str(dateSelected)
  
  def setData():
   dateSel=tkCalender()
   txtBoxDate.delete(0,END)
   txtBoxDate.insert(0,dateSel)
  
   return
  
  root=Tk()
  
  #Frame
  miFrame=Frame(root,width=1200,height=2000)
  miFrame.pack()
  miFrame.config(bg="black")
  
  
  
  miLabel=Label(miFrame, text="Date: ",fg="green", bg="black", font="Comic")
  miLabel.grid(row=1,column=1,padx=10,pady=10)
  
  txtBoxDate=Entry(miFrame)
  txtBoxDate.grid(row=1,column=2,padx=10,pady=10,ipadx=40,ipady=2.5)
  
  buttonDate=Button(miFrame, text="Date",command=lambda:setData())
  
  buttonDate.grid(row=1,column=3,padx=10,pady=10)
  
  
  
  root.mainloop()
  </code></pre>
  
  <p><strong>calenderUI.py</strong></p>
  
  <pre><code>from tkcalendar import Calendar
  from tkinter import Tk
  from tkinter import ttk
  
  
  def tkCalender():
   def print_sel():
    print(cal.selection_get())
  
   root = Tk()
   cal=Calendar(root)
   cal.pack()
  
   ttk.Button(root, text="Select",command=print_sel).pack()
  
   root.mainloop()
  
  if __name__ == '__tkCalender__':
   tkCalender()
  
  </code></pre>
  
  <p>Waiting for your help, thanks!</p>