Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. from tkinter import*
  2. tk=Tk()
  3. tk.geometry("260x350")
  4. def btn_click():
  5. ent.insert(END,"7")
  6. def b1_click():
  7. ent.delete(0, END)
  8. def btn1_click():
  9. ent.insert(END,"8")
  10. def btn2_click():
  11. ent.insert(END,"9")
  12. def btn3_click():
  13. ent.insert(END,"6")
  14. def btn4_click():
  15. ent.insert(END,"5")
  16. def btn5_click():
  17. ent.insert(END,"4")
  18. def btn6_click():
  19. ent.insert(END,"3")
  20. def btn7_click():
  21. ent.insert(END,"2")
  22. def btn8_click():
  23. ent.insert(END,"1")
  24. def btn9_click():
  25. ent.insert(END,"0")
  26. def btn10_click():
  27. ent.insert(END,".")
  28. def btn11_click():
  29. ent.insert(END,"/")
  30. def btn12_click():
  31. ent.insert(END,"*")
  32. def btn13_click():
  33. ent.insert(END,"-")
  34. def btn14_click():
  35. ent.insert(END,"+")
  36. ent=Entry(justify="right", font="14")
  37. ent.place(x=20,y=20, width=220, height=30)
  38. BC=Button(text="C", font="14", command=b1_click)
  39. BC.place(x=20,y=70,width=100,height=40)
  40. Equal=Button(text="=", font="14")
  41. Equal.place(x=140,y=70,width=100,height=40)
  42. B7=Button(text="7", font="14", command=btn_click)
  43. B7.place(x=20,y=130, width=40, height=40)
  44. B8=Button(text="8", font="14", command=btn1_click)
  45. B8.place(x=80,y=130, width=40, height=40)
  46. B9=Button(text="9", font="14", command=btn2_click)
  47. B9.place(x=140,y=130, width=40, height=40)
  48. B6=Button(text="6", font="14", command=btn3_click)
  49. B6.place(x=140,y=180, width=40, height=40)
  50. B5=Button(text="5", font="14", command=btn4_click)
  51. B5.place(x=80,y=180, width=40, height=40)
  52. B4=Button(text="4", font="14", command=btn5_click)
  53. B4.place(x=20,y=180, width=40, height=40)
  54. B3=Button(text="3", font="14", command=btn6_click)
  55. B3.place(x=140,y=230, width=40, height=40)
  56. B2=Button(text="2", font="14", command=btn7_click)
  57. B2.place(x=80,y=230, width=40, height=40)
  58. B1=Button(text="1", font="14", command=btn8_click)
  59. B1.place(x=20,y=230, width=40, height=40)
  60. B0=Button(text="0", font="14", command=btn9_click)
  61. B0.place(x=20,y=280, width=100, height=40)
  62. B=Button(text=".", font="14", command=btn10_click)
  63. B.place(x=140,y=280, width=40, height=40)
  64. B11=Button(text="/", font="14", command=btn11_click)
  65. B11.place(x=200,y=130, width=40, height=40)
  66. B12=Button(text="*", font="14", command=btn12_click)
  67. B12.place(x=200,y=180, width=40, height=40)
  68. B13=Button(text="-", font="14", command=btn13_click)
  69. B13.place(x=200,y=230, width=40, height=40)
  70. B13=Button(text="+", font="14", command=btn14_click)
  71. B13.place(x=200,y=280, width=40, height=40)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement