Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import*
- tk=Tk()
- tk.geometry("260x350")
- def btn_click():
- ent.insert(END,"7")
- def b1_click():
- ent.delete(0, END)
- def btn1_click():
- ent.insert(END,"8")
- def btn2_click():
- ent.insert(END,"9")
- def btn3_click():
- ent.insert(END,"6")
- def btn4_click():
- ent.insert(END,"5")
- def btn5_click():
- ent.insert(END,"4")
- def btn6_click():
- ent.insert(END,"3")
- def btn7_click():
- ent.insert(END,"2")
- def btn8_click():
- ent.insert(END,"1")
- def btn9_click():
- ent.insert(END,"0")
- def btn10_click():
- ent.insert(END,".")
- def btn11_click():
- ent.insert(END,"/")
- def btn12_click():
- ent.insert(END,"*")
- def btn13_click():
- ent.insert(END,"-")
- def btn14_click():
- ent.insert(END,"+")
- ent=Entry(justify="right", font="14")
- ent.place(x=20,y=20, width=220, height=30)
- BC=Button(text="C", font="14", command=b1_click)
- BC.place(x=20,y=70,width=100,height=40)
- Equal=Button(text="=", font="14")
- Equal.place(x=140,y=70,width=100,height=40)
- B7=Button(text="7", font="14", command=btn_click)
- B7.place(x=20,y=130, width=40, height=40)
- B8=Button(text="8", font="14", command=btn1_click)
- B8.place(x=80,y=130, width=40, height=40)
- B9=Button(text="9", font="14", command=btn2_click)
- B9.place(x=140,y=130, width=40, height=40)
- B6=Button(text="6", font="14", command=btn3_click)
- B6.place(x=140,y=180, width=40, height=40)
- B5=Button(text="5", font="14", command=btn4_click)
- B5.place(x=80,y=180, width=40, height=40)
- B4=Button(text="4", font="14", command=btn5_click)
- B4.place(x=20,y=180, width=40, height=40)
- B3=Button(text="3", font="14", command=btn6_click)
- B3.place(x=140,y=230, width=40, height=40)
- B2=Button(text="2", font="14", command=btn7_click)
- B2.place(x=80,y=230, width=40, height=40)
- B1=Button(text="1", font="14", command=btn8_click)
- B1.place(x=20,y=230, width=40, height=40)
- B0=Button(text="0", font="14", command=btn9_click)
- B0.place(x=20,y=280, width=100, height=40)
- B=Button(text=".", font="14", command=btn10_click)
- B.place(x=140,y=280, width=40, height=40)
- B11=Button(text="/", font="14", command=btn11_click)
- B11.place(x=200,y=130, width=40, height=40)
- B12=Button(text="*", font="14", command=btn12_click)
- B12.place(x=200,y=180, width=40, height=40)
- B13=Button(text="-", font="14", command=btn13_click)
- B13.place(x=200,y=230, width=40, height=40)
- B13=Button(text="+", font="14", command=btn14_click)
- B13.place(x=200,y=280, width=40, height=40)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement