title: How to show the value of a variable in GUI using tkinter?
body: <p>I'm trying to display the value of the variable <code>var</code> in GUI using tkinter with the <code>set</code> method.
  It shows the text without the value when I run the program. What should I modify to make it display the value of the variable <code>var</code>?</p>
  <p>My code:</p>
  <pre><code># import modules
  from tkinter import *
  
  from tkinter import messagebox
  
  def cricket_info():
  
      try:
         # match = sports.get_match(sports.CRICKET, e1.get() , e2.get())
          var=45
          date.set(str(var))
  
      except:
          messagebox.showerror(&quot;showerror&quot;, &quot;No match found&quot;)
  
  
  
  
  # object of tkinter
  # and background set for light grey
  master = Tk()
  master.configure(bg='light grey')
  
  # Variable Classes in tkinter
  date = StringVar();
  
  
  # Creating label for each information
  # name using widget Label
  Label(master, text=&quot;Date :&quot; , bg = &quot;light grey&quot;).grid(row=2, sticky=W)
  
  
  
  # Creating lebel for class variable
  # name using widget Entry
  Label(master, text=&quot;&quot;, textvariable= date ,bg = &quot;light grey&quot;).grid(row=2,column=1, sticky=W)
  
  
  
  e1 = Entry(master)
  e1.grid(row=0, column=1)
  
  e2 = Entry(master)
  e2.grid(row=1, column=1)
  
  # creating a button using the widget
  # Button that will call the submit function
  b = Button(master, text=&quot;Show&quot;, command=cricket_info )
  b.grid(row=0, column=2,columnspan=2, rowspan=2,padx=5, pady=5)
  
  mainloop()
  
  </code></pre>