from tkinter import * 
master=Tk()
def click(event):
	global Mytext
	text=event.widget.cget("text")
	if text=="=":
		if Mytext.get().isdigit():
			value=int(Mytext.get())
		else:
			value= eval(e1.get())
		Mytext.set(value)
		e1.update()
		e1.update()
	elif text=="clear":
		Mytext.set("")
		e1.update()
	else:
		Mytext.set(Mytext.get() + text)
		e1.update()
master.geometry("644x986")
master.title("Akash Calculator")
#master.wm_iconbitma("1.ico")

Mytext=StringVar()
Mytext.set("")
e1=Entry(master,textvar=Mytext, font="Lucida 40 bold")
e1.pack(fill=X,ipadx=8,pady=10,padx=10)
f= Frame(master,bg="red")
f.pack()
b1=Button(f,text="9",font="lucida 15 bold",pady=10,padx=10)
b1.pack(side=LEFT,padx=18,pady=12)
b1.bind("<Button-1>",click)
b2=Button(f,text="8",font="lucida 15 bold",pady=10,padx=10)
b2.pack(side=LEFT,padx=18,pady=12)
b2.bind("<Button-1>",click)
b3=Button(f,text="7",font="lucida 15 bold",pady=10,padx=10)
b3.pack(side=LEFT,padx=18,pady=12)
b3.bind("<Button-1>",click)
f2= Frame(master,bg="red")
f2.pack()
b4=Button(f2,text="6",font="lucida 15 bold",pady=10,padx=10)
b4.pack(side=LEFT,padx=18,pady=12)
b4.bind("<Button-1>",click)
b5=Button(f2,text="5",font="lucida 15 bold",pady=10,padx=10)
b5.pack(side=LEFT,padx=18,pady=12)
b5.bind("<Button-1>",click)
b6=Button(f2,text="4",font="lucida 15 bold",pady=10,padx=10)
b6.pack(side=LEFT,padx=18,pady=12)
b6.bind("<Button-1>",click)
f3= Frame(master,bg="red")
f3.pack()
b7=Button(f3,text="3",font="lucida 15 bold",pady=10,padx=10)
b7.pack(side=LEFT,padx=18,pady=12)
b7.bind("<Button-1>",click)
b8=Button(f3,text="2",font="lucida 15 bold",pady=10,padx=10)
b8.pack(side=LEFT,padx=18,pady=12)
b8.bind("<Button-1>",click)
b9=Button(f3,text="1",font="lucida 15 bold",pady=10,padx=10)
b9.pack(side=LEFT,padx=18,pady=12)
b9.bind("<Button-1>",click)
f4= Frame(master,bg="red")
f4.pack()
b10=Button(f4,text="0",font="lucida 15 bold",pady=10,padx=10)
b10.pack(side=LEFT,padx=18,pady=12)
b10.bind("<Button-1>",click)
b11=Button(f4,text="-",font="lucida 15 bold",pady=10,padx=10)
b11.pack(side=LEFT,padx=18,pady=12)
b11.bind("<Button-1>",click)
b12=Button(f4,text="*",font="lucida 15 bold",pady=10,padx=10)
b12.pack(side=LEFT,padx=18,pady=12)
b12.bind("<Button-1>",click)
f5= Frame(master,bg="red")
f5.pack()
b13=Button(f5,text="/",font="lucida 15 bold",pady=10,padx=10)
b13.pack(side=LEFT,padx=18,pady=12)
b13.bind("<Button-1>",click)
b14=Button(f5,text="+",font="lucida 15 bold",pady=10,padx=10)
b14.pack(side=LEFT,padx=18,pady=12)
b14.bind("<Button-1>",click)
b15=Button(f5,text="=",font="lucida 15 bold",pady=10,padx=10)
b15.pack(side=LEFT,padx=18,pady=12)
b15.bind("<Button-1>",click)
fx= Frame(master,bg="grey")
fx.pack()
b16=Button(fx,text="clear",font="lucida 15 bold",pady=10,padx=10)
b16.pack(side=LEFT,padx=18,pady=12)
b16.bind("<Button-1>",click)
mainloop()