Как обновлять другое окно в TKinter
По задумке это обычный блэкджэк, но мне нужно обновлять d, чтобы добавлялись карты при нажатии кнопки. Я пробовал различные способы описанные в интернете, но ничего не помогло мне.
def creategame():
game = Toplevel(root)
game.title('Игра')
game.geometry("1880x1260+0+0")
Button(game , command= button_give,text= "Взять карту").pack()
h = Label(game , text=robot_current ,font= "Times 80",width= 100 ).pack()
d = Label(game,text=global_current , font= "Times 80",height = 900,width= 50)
d.pack()
Функция button give:
def button_give():
current = a.pop()
#count += current
'''if count > 21:
count == 0'''
if current == 11 :
current = random.choice(piki)
if current == 2:
current = random.choice(dva)
if current == 3:
current = random.choice(three)
if current == 4:
current = random.choice(four)
if current == 5:
current = random.choice(five)
if current == 6:
current = random.choice(six)
if current == 7:
current = random.choice(seven)
if current == 8:
current = random.choice(eigth)
if current == 9:
current = random.choice(nine)
if current == 10:
current = random.choice(ten)
global_current.append(current)
Источник: Stack Overflow на русском