Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # код, до меня
- def forget_s(event):
- global button
- if button == 1:
- b1.place(x=50, y=70)
- elif button == 2:
- b2.place(x=150, y=70)
- elif button == 3:
- b3.place(x=250, y=70)
- elif button == 4:
- b4.place(x=350, y=70)
- if s.get() == 1:
- b1.place_forget()
- button = 1
- elif s.get() == 2:
- b2.place_forget()
- button = 2
- elif s.get() == 3:
- b3.place_forget()
- button = 3
- elif s.get() == 4:
- b4.place_forget()
- button = 4
- l.config(text="Кнопка скрыта:" + str(button))
- # код, после меня
- def forget_s(event):
- global button
- globals()['b' + str(button)].pack()
- button = s.get()
- globals()['b' + str(s.get())].pack_forget()
- l.config(text="Кнопка скрыта:" + str(button))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement