Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. from tkinter import * #
  2. root Tk ()
  3. def func1 (ven) :
  4. # importing the tkinter module
  5. # creating the main window
  6. # function func1
  7. # eminna s acquires the contents of a single-line text field
  8. cent. get ()
  9. if s "Dynamo": # if the name of Dynamo is entered
  10. tex. delete (1.0, end)
  11. tex. insert (END, "the champion of Ukraine in
  12. # deleting text from a text file
  13. # in the text field, insert the years when Dynamo was the champion
  14. Mitya-
  15. row
  16. 2014-2015, 2015-2016")
  17. elif s " Shakhtar" :
  18. tex. delete (1.0, END)
  19. #
  20. # If the name miner is entered
  21. # deleting text from a text file
  22. # in the text field there are those years when the miner was a champion
  23. else:
  24. tex. insert (END, "the champion of Ukraine in)
  25. 2010-2011, 2011-2012, 2012-2013, 2013-2014")
  26. tex. delete (1.0, END)
  27. tex. insert (END, "This team was not the champion")
  28. # if you entered a different command name
  29. # deleting text from a text file
  30. enter Entry(root, width=10, bg= " yellow")
  31. # alignment. single-row text.
  32. but Button(root, text = "Run", bg= 'magenta')
  33. # creating a button
  34. # creating a multi-line text field
  35. tex = Text (root, width=20, bg= 'lightblue', height=4, font= "12", wrap=WORD)
  36. ent. grid (row=0, column=0, padx=2, pady=10)
  37. # the location of one. text. fields
  38. but. grid (row=0, column=1, padx=12, pady=10) # placement in the button window
  39. tex. grid (row=0, column=2, padx=20, pady=10) # placement is rich. text.
  40. but. bind (""Button-1>", funcl)
  41. # linking the button click event to func
  42. root. mainloop ()
  43. # display on the window screen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement