Я новичок в tkinter, моя проблема в следующем: у меня есть кнопка, которая при нажатии запускает функцию, которая создает переменную, которую я хочу сравнить в if, поэтому мне нужно каким-то образом сохранить значениепеременная.
def windowOp1():
def aleatoria():
op = 0
print("Usted eligio la opcion aleatoria")
return op
def manual():
op = 1
print("Usted eligio la opcion manual")
return op
wn = Toplevel(root)
wn.geometry("400x200+300+300")
volver = Button(wn, text="Volver", command = quit).place(x = 0, y = 0)
titulo = Label(wn, text = "Elija una opcion de carga de datos").place(x = 115, y = 40)
aleatoria = Button(wn, text = "Aleatoria", command = aleatoria).place(x = 170, y = 70)
manual = Button(wn, text = "Manual", command = manual).place(x = 170, y = 100)