Advertisement
virtualideaz

simple python calculator w/o event

Oct 6th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. from tkinter import messagebox
  4.  
  5. root = Tk()
  6.  
  7.  
  8. text1 = Text(root, height=3, width=28)
  9. text1.place(x=0,y=0)
  10. #add buttons
  11. Button1 = Button(root, text="7", height=2, width=5)
  12. Button1.place(x=0,y=50)
  13. Button2 = Button(root, text="4", height=2, width=5)
  14. Button2.place(x=0,y=90)
  15. Button3 = Button(root, text="1", height=2, width=5)
  16. Button3.place(x=0,y=130)
  17. Button4 = Button(root, text="8", height=2, width=5)
  18. Button4.place(x=45,y=50)
  19. Button5 = Button(root, text="5", height=2, width=5)
  20. Button5.place(x=45,y=90)
  21. Button6 = Button(root, text="2", height=2, width=5)
  22. Button6.place(x=45,y=130)
  23. Button7 = Button(root, text="9", height=2, width=5)
  24. Button7.place(x=90,y=50)
  25. Button8 = Button(root, text="6", height=2, width=5)
  26. Button8.place(x=90,y=90)
  27. Button9 = Button(root, text="3", height=2, width=5)
  28. Button9.place(x=90,y=130)
  29. Button10 = Button(root, text="*", height=2, width=5)
  30. Button10.place(x=135,y=50)
  31. Button11 = Button(root, text="-", height=2, width=5)
  32. Button11.place(x=135,y=90)
  33. Button12 = Button(root, text="+", height=2, width=5)
  34. Button12.place(x=135,y=130)
  35. Button13 = Button(root, text="/", height=3, width=5)
  36. Button13.place(x=180,y=50)
  37. Button14 = Button(root, text="=", height=4, width=5)
  38. Button14.place(x=180,y=100)
  39.  
  40. root.geometry("227x175")
  41. root.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement