Here we are providing basic tutorial in Tkinter on how to get entry data in Tkinter programs.

Consider this code

from tkinter import *

root=Tk()

Label1 = Label(root, text = "Enter your expression : ")
Label1.pack()

def evaluate(event):
    data = e.get()
    ans.configure(text = "Answer : " + str(eval(data)))

e = Entry(root)

e.bind("<Return>", evaluate)
e.pack()
ans = Label(root)
ans.pack()

root.mainloop()

In the above code, a method evaluate is used to get the data entered in an entry using the get method. Another thing to notice is configure method that is used to display the data entered in an entry as a label. Rest code is self-explanatory.

Output

output