Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- teamonescore = 0
- teamtwoscore = 0
- def scoreIncrease(team):
- if team == "1":
- teamonescore = teamonescore + 1
- text_file = open("teamonescore.txt")
- text_file.write("Test")
- text_file.close()
- elif team == "2":
- teamonescore = teamtwoscore + 1
- writeToFile(teamtwoscore, teamtwoscore)
- elif team == "3":
- teamonescore = 0
- writeToFile(teamonescore, teamonescore)
- elif team == "4":
- teamonescore = 0
- writeToFile(teamtwoscore, teamtwoscore)
- root = Tk()
- title = Label(root, text = "Tournament Stream Overlay Tool", font = "BigNoodleTitling")
- title.grid(row = 0, column = 1)
- ## Generates text next to input area for team one
- teamone = Label(root, text = "Team 1 Name", font = "BigNoodleTitling")
- teamone.grid(row = 2, column = 1, sticky = W)
- ## Input box for team one
- teamoneinput = Entry(root)
- teamoneinput.grid(row = 2, column = 2)
- ## Generates text next to input area for team two
- teamone = Label(root, text = "Team 2 Name", font = "BigNoodleTitling")
- teamone.grid(row = 3, column = 1, sticky = W)
- ## Input box for team two
- teamtwoinput = Entry(root)
- teamtwoinput.grid(row = 3, column = 2)
- ## Displays the score of team 1
- title = Label(root, text = "Team one score", font = "BigNoodleTitling")
- title.grid(row = 4, column = 1, sticky = W)
- ## Button to increase score of team 1
- increasescoreone = Button(root, text = "+1",font = "BigNoodleTitling", command = scoreIncrease(1))
- increasescoreone.grid(row = 4, column = 3, sticky = E)
- ## Button to reset score of team 1
- increasescoreone = Button(root, text = "Reset",font = "BigNoodleTitling", command = scoreIncrease(3))
- increasescoreone.grid(row = 4, column = 2, sticky = E)
- ## Displays the score of team 2
- title = Label(root, text = "Team two score", font = "BigNoodleTitling")
- title.grid(row = 5, column = 1, sticky = W)
- ## Button to increase score of team 2
- increasescoreone = Button(root, text = "+1",font = "BigNoodleTitling", command = scoreIncrease(2))
- increasescoreone.grid(row = 5, column = 3, sticky = E)
- ## Button to reset score of team 2
- increasescoreone = Button(root, text = "Reset",font = "BigNoodleTitling", command = scoreIncrease(4))
- increasescoreone.grid(row = 5, column = 2, sticky = E)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement