title: Python-How to get the value from tkinter widget and assign it to a variable
body: <pre><code>from tkinter import *
  import tkinter as tk
  import pyodbc
  
  root1 = tk.Tk()
  
  label1 = tk.Label(root1, text='product A')
  entry1 = tk.Entry(root1)
  
  label1.pack(side = tk.TOP)
  entry1.pack()
  input1= StringVar()
  input1.set(entry1.get())
  print (input1)
  </code></pre>
  
  <p>This code is used to assign the value from the input textbox widget to a variable-Input1. However,the value I get is:PY_VAR0 instead of the text in Entry1.</p>
  
  <p>I need to print the input text. Why is PY_VAR0 appearing?</p>
  
  <p>Please help.</p>
  
  <p>Thank you. </p>