from tkinter import *
from tkinter import messagebox as g
from PIL import Image, ImageTk
root = Tk()
root.geometry('300x150+550+300')
image1 = Image.open('C:\\Users\\Python\\Desktop\\你好.png ')
image2 = ImageTk.PhotoImage(image1)
to = Label(root, image=image2)
to.pack()
def ji():
b_g = str(eval(b.get()))
g.showinfo('结果', '%s' % b_g)
Label(root, text='请输入', font=('宋体', 15)).place(x=10, y=30)
b = Entry(root, font=('宋体', 15))
b.place(x=80, y=30)
c = Button(root, text='计算', bg='yellow', fg='blue', command=ji)
c.place(x=80, y=70)
root.mainloop()