Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import * #
- root Tk ()
- def func1 (ven) :
- # importing the tkinter module
- # creating the main window
- # function func1
- # eminna s acquires the contents of a single-line text field
- cent. get ()
- if s "Dynamo": # if the name of Dynamo is entered
- tex. delete (1.0, end)
- tex. insert (END, "the champion of Ukraine in
- # deleting text from a text file
- # in the text field, insert the years when Dynamo was the champion
- Mitya-
- row
- 2014-2015, 2015-2016")
- elif s " Shakhtar" :
- tex. delete (1.0, END)
- #
- # If the name miner is entered
- # deleting text from a text file
- # in the text field there are those years when the miner was a champion
- else:
- tex. insert (END, "the champion of Ukraine in)
- 2010-2011, 2011-2012, 2012-2013, 2013-2014")
- tex. delete (1.0, END)
- tex. insert (END, "This team was not the champion")
- # if you entered a different command name
- # deleting text from a text file
- enter Entry(root, width=10, bg= " yellow")
- # alignment. single-row text.
- but Button(root, text = "Run", bg= 'magenta')
- # creating a button
- # creating a multi-line text field
- tex = Text (root, width=20, bg= 'lightblue', height=4, font= "12", wrap=WORD)
- ent. grid (row=0, column=0, padx=2, pady=10)
- # the location of one. text. fields
- but. grid (row=0, column=1, padx=12, pady=10) # placement in the button window
- tex. grid (row=0, column=2, padx=20, pady=10) # placement is rich. text.
- but. bind (""Button-1>", funcl)
- # linking the button click event to func
- root. mainloop ()
- # display on the window screen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement