import tkinter as tk
window = tk.Tk()
window.title("")
window.geometry("360x435")
window.attributes("-alpha", 0.95)
window.resizable(0, 0)-sharp
var = tk.StringVar()
frm_1 = tk.Frame(window, width=360, height=115, bg="CadetBlue").place(x=0, y=0, anchor=tk.NW)-sharp
frm_2 = tk.Frame(window, width=270, height=240, bg="DarkSeaGreen").place(x=0, y=115, anchor=tk.NW)-sharp
frm_3 = tk.Frame(window, width=90, height=320, bg="Beige").place(x=270, y=115, anchor=tk.NW)-sharp
frm_4 = tk.Frame(window, width=270, height=80, bg="CadetBlue").place(x=0, y=355, anchor=tk.NW)-sharp
var_result = tk.StringVar()
var_dian=tk.StringVar()
var_dian.set(".")
def name(u):
u="var"+str(u)
return u
-sharp
I = tk.Entry(frm_1,textvariable=var_result,font=("Arial",40),bg="grey")
I.place(x=0,y=0,width=360,height=115)
-sharp
-sharp
-sharp
def show_result():
result = I.get()
print(eval(result))
def delete():
f.delete(1.0, tk.END)
def get():
pass
num=1
-sharp
for j in range(3):
for i in range(3):
m=0+(i)*90
n=115+(j)*80
b=tk.Button(frm_2,text=num,bg="WhiteSmoke",font=("Arial","20"),command=get)
b.place(x=m,y=n,width=90,height=80)
num=num+1
-sharp
v=0
a=tk.Button(frm_4,textvariable=var_dian,bg="Gainsboro",font=("20")).place(x=0,y=355,width=90,height=80)
b=tk.Button(frm_4,text="=",bg="Gainsboro",font=("20"),command=show_result).place(x=180,y=355,width=90,height=80)
f=tk.Button(frm_4,text="0",bg="WhiteSmoke",font=("Arial","20")).place(x=90,y=355,width=90,height=80)
-sharp
q=0
for p in ["+","-","*","/"]:
e=tk.Button(frm_3,text=p,bg="Gainsboro",font=("20")).place(x=270,y=115+q*80,width=90,height=80)
q=q+1
window.mainloop()