from tkinter import *
root = Tk()
def evalute(event):
data = e.get()
ans.configure(text="Answer:"+str(eval(data)))
title = Label(text="请输入表达式:")
title.pack()
e = Entry(root)
e.bind("<Return>",evalute)
e.pack()
ans = Label(root)
ans.pack()
root.mainloop()