Advertisement
Guest User

Untitled

a guest
Apr 30th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root = Tk()
  4. root.title("Calculator")
  5. root.resizable(0, 0)
  6.  
  7. myButton1 = Button(root, text="1", width="14", height="6", bg="red")
  8. myButton2 = Button(root, text="2", width="14", height="6", bg="red")
  9. myButton3 = Button(root, text="3", width="14", height="6", bg="red")
  10. myButton4 = Button(root, text="4", width="14", height="6", bg="red")
  11. myButton5 = Button(root, text="5", width="14", height="6", bg="red")
  12. myButton6 = Button(root, text="6", width="14", height="6", bg="red")
  13. myButton7 = Button(root, text="7", width="14", height="6", bg="red")
  14. myButton8 = Button(root, text="8", width="14", height="6", bg="red")
  15. myButton9 = Button(root, text="9", width="14", height="6", bg="red")
  16. myButton10 = Button(root, text="+", width="14", height="6", bg="red")
  17. myButton11 = Button(root, text="-", width="14", height="6", bg="red")
  18. myButton12 = Button(root, text="/", width="14", height="6", bg="red")
  19. myButton13 = Button(root, text="*", width="14", height="6", bg="red")
  20. myButton14 = Button(root, text="=", width="14", height="6", bg="red")
  21. myButton15 = Button(root, text="C", width="30", height="6", bg="red")
  22. myButton16 = Button(root, text=",", width="14", height="6", bg="red")
  23. myButton17 = Button(root, text="g", width="14", height="6", bg="red")
  24. myButton18 = Button(root, text="0", width="30", height="6", bg="red")
  25.  
  26. myButton1.grid(row=5, column=0, sticky="W")
  27. myButton2.grid(row=5, column=1, sticky="W")
  28. myButton3.grid(row=5, column=2, sticky="W")
  29. myButton4.grid(row=4, column=0, sticky="W")
  30. myButton5.grid(row=4, column=1, sticky="W")
  31. myButton6.grid(row=4, column=2, sticky="W")
  32. myButton7.grid(row=3, column=0, sticky="W")
  33. myButton8.grid(row=3, column=1, sticky="W")
  34. myButton9.grid(row=3, column=2, sticky="W")
  35. myButton10.grid(row=5, column=3, sticky="W")
  36. myButton11.grid(row=4, column=3, sticky="W")
  37. myButton12.grid(row=1, column=3, sticky="W")
  38. myButton13.grid(row=3, column=3, sticky="W")
  39. myButton14.grid(row=6, column=3, sticky="W")
  40. myButton15.grid(row=1, column=0, columnspan=3, sticky="W")
  41. myButton16.grid(row=6, column=2, sticky="W")
  42. myButton17.grid(row=1, column=2, sticky="W")
  43. myButton18.grid(row=6, column=0, columnspan=3, sticky="W")
  44.  
  45.  
  46.  
  47. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement