Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. teamonescore = 0
  4. teamtwoscore = 0
  5.  
  6.  
  7. def scoreIncrease(team):
  8.  
  9. if team == "1":
  10. teamonescore = teamonescore + 1
  11. text_file = open("teamonescore.txt")
  12. text_file.write("Test")
  13. text_file.close()
  14.  
  15. elif team == "2":
  16. teamonescore = teamtwoscore + 1
  17. writeToFile(teamtwoscore, teamtwoscore)
  18.  
  19. elif team == "3":
  20. teamonescore = 0
  21. writeToFile(teamonescore, teamonescore)
  22.  
  23. elif team == "4":
  24. teamonescore = 0
  25. writeToFile(teamtwoscore, teamtwoscore)
  26.  
  27.  
  28.  
  29. root = Tk()
  30.  
  31. title = Label(root, text = "Tournament Stream Overlay Tool", font = "BigNoodleTitling")
  32. title.grid(row = 0, column = 1)
  33.  
  34.  
  35. ## Generates text next to input area for team one
  36. teamone = Label(root, text = "Team 1 Name", font = "BigNoodleTitling")
  37. teamone.grid(row = 2, column = 1, sticky = W)
  38.  
  39. ## Input box for team one
  40. teamoneinput = Entry(root)
  41. teamoneinput.grid(row = 2, column = 2)
  42.  
  43. ## Generates text next to input area for team two
  44. teamone = Label(root, text = "Team 2 Name", font = "BigNoodleTitling")
  45. teamone.grid(row = 3, column = 1, sticky = W)
  46.  
  47. ## Input box for team two
  48. teamtwoinput = Entry(root)
  49. teamtwoinput.grid(row = 3, column = 2)
  50.  
  51. ## Displays the score of team 1
  52. title = Label(root, text = "Team one score", font = "BigNoodleTitling")
  53. title.grid(row = 4, column = 1, sticky = W)
  54.  
  55. ## Button to increase score of team 1
  56. increasescoreone = Button(root, text = "+1",font = "BigNoodleTitling", command = scoreIncrease(1))
  57. increasescoreone.grid(row = 4, column = 3, sticky = E)
  58.  
  59. ## Button to reset score of team 1
  60. increasescoreone = Button(root, text = "Reset",font = "BigNoodleTitling", command = scoreIncrease(3))
  61. increasescoreone.grid(row = 4, column = 2, sticky = E)
  62.  
  63. ## Displays the score of team 2
  64. title = Label(root, text = "Team two score", font = "BigNoodleTitling")
  65. title.grid(row = 5, column = 1, sticky = W)
  66.  
  67. ## Button to increase score of team 2
  68. increasescoreone = Button(root, text = "+1",font = "BigNoodleTitling", command = scoreIncrease(2))
  69. increasescoreone.grid(row = 5, column = 3, sticky = E)
  70.  
  71. ## Button to reset score of team 2
  72. increasescoreone = Button(root, text = "Reset",font = "BigNoodleTitling", command = scoreIncrease(4))
  73. increasescoreone.grid(row = 5, column = 2, sticky = E)
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement