title: How to enter number in Entry using button in tkinter
body: <p>I want to add numbers (only 4 numbers) to entry via button in tkinter.
  I tried  this code but it's not working. I need some suggestions.</p>
  
  <pre><code>import tkinter as tk
  win = tk.Tk()
  
  var = tk.StringVar()
  var_entry = tk.Entry(win,text='var',textvariable=var)
  
  def handle_button(event):
      return var.insert(0,4)
  
  def window():
      global win
      var_entry.grid(row =1 ,column =2)
  
      button1 = tk.Button(win,text = '1' ,textvariable = 1)
      button1.bind("&lt;Button-1&gt;", handle_button)
      button1.grid(row = 2 , column = 0)
      # similarly I defined all the buttons.
  
  
  windows()
  win.mainloop()
  </code></pre>
  
  <p>The error it shows is:</p>
  
  <blockquote>
    <p>AttributeError: 'StringVar' object has no attribute 'insert'</p>
  </blockquote>