Advertisement
Allena_Gorskaya

Untitled

Feb 27th, 2019
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #заготовка для радуги
  2. from tkinter import *
  3.  
  4. root = Tk()
  5.  
  6. Lbl = Label(width=20)
  7.  
  8. def f1(event):
  9. Lbl['text'] = 'красный'
  10.  
  11.  
  12. btn1 = Button(width = 20, bg = 'red')
  13. btn2 = Button(width = 20, bg = 'orange')
  14. btn3 = Button(width = 20, bg = 'yellow')
  15.  
  16. btn1.bind('<Button-1>', f1)
  17.  
  18. Lbl.pack()
  19. btn1.pack()
  20. btn2.pack()
  21. btn3.pack()
  22.  
  23. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement