tkinter The Tkinter Entry Widget Getting the value of an Entry widget


Example

The value of an entry widget can be obtained with the get method of the widget:

name_entry = tk.Entry(parent)
...
name = name_entry.get()

Optionally, you may associate an instance of a StringVar, and retrieve the value from the StringVar rather than from the widget:

name_var = tk.StringVar()
name_entry = tk.Entry(parent, textvariable=name_var)
...
name = name_var.get()