Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root = Tk()
- root.title("Calculator")
- root.resizable(0, 0)
- myButton1 = Button(root, text="1", width="14", height="6", bg="red")
- myButton2 = Button(root, text="2", width="14", height="6", bg="red")
- myButton3 = Button(root, text="3", width="14", height="6", bg="red")
- myButton4 = Button(root, text="4", width="14", height="6", bg="red")
- myButton5 = Button(root, text="5", width="14", height="6", bg="red")
- myButton6 = Button(root, text="6", width="14", height="6", bg="red")
- myButton7 = Button(root, text="7", width="14", height="6", bg="red")
- myButton8 = Button(root, text="8", width="14", height="6", bg="red")
- myButton9 = Button(root, text="9", width="14", height="6", bg="red")
- myButton10 = Button(root, text="+", width="14", height="6", bg="red")
- myButton11 = Button(root, text="-", width="14", height="6", bg="red")
- myButton12 = Button(root, text="/", width="14", height="6", bg="red")
- myButton13 = Button(root, text="*", width="14", height="6", bg="red")
- myButton14 = Button(root, text="=", width="14", height="6", bg="red")
- myButton15 = Button(root, text="C", width="30", height="6", bg="red")
- myButton16 = Button(root, text=",", width="14", height="6", bg="red")
- myButton17 = Button(root, text="g", width="14", height="6", bg="red")
- myButton18 = Button(root, text="0", width="30", height="6", bg="red")
- myButton1.grid(row=5, column=0, sticky="W")
- myButton2.grid(row=5, column=1, sticky="W")
- myButton3.grid(row=5, column=2, sticky="W")
- myButton4.grid(row=4, column=0, sticky="W")
- myButton5.grid(row=4, column=1, sticky="W")
- myButton6.grid(row=4, column=2, sticky="W")
- myButton7.grid(row=3, column=0, sticky="W")
- myButton8.grid(row=3, column=1, sticky="W")
- myButton9.grid(row=3, column=2, sticky="W")
- myButton10.grid(row=5, column=3, sticky="W")
- myButton11.grid(row=4, column=3, sticky="W")
- myButton12.grid(row=1, column=3, sticky="W")
- myButton13.grid(row=3, column=3, sticky="W")
- myButton14.grid(row=6, column=3, sticky="W")
- myButton15.grid(row=1, column=0, columnspan=3, sticky="W")
- myButton16.grid(row=6, column=2, sticky="W")
- myButton17.grid(row=1, column=2, sticky="W")
- myButton18.grid(row=6, column=0, columnspan=3, sticky="W")
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement