it's easy, i have to replace the Label "risdado" in appdadi with the Label "rispodado" from dado6 function.
but when i click on the button "tira6" it gives me
NameError: global name 'risdado' is not defined
i've allready used this system in another case and it runs fine, the difference in that case was that the target (where to replace the label) was not a function-generated window.
i'm a very beginner so, if is only a careless mistake, sorry.
ask for more detail.
from Tkinter import *
from tkMessageBox import *
from random import *
#DICE 6
#---------
def dado6():
risdado.pack_forget()
a=randint(1,6)
rispodado=Label(appdadi, text=a, font=(Helvetica, 20)).pack()
#DICE APP
#-------
def dadi():
appdadi=Tk()
appdadi.resizable(0,0)
dicepace1=Label(appdadi, bg="#009E71", width=40).pack(fill=X)
labdadi=Label(appdadi, text="- D & D - DICE -", font=("Helvetica", 12), fg="White", bg="#009E71").pack(fill=X)
dicespace2=Label(appdadi, bg="#009E71").pack(fill=X)
dicespace3=Label(appdadi,).pack()
tira6=Button(appdadi, text="dado da 6", command=dado6).pack()
tira21=Button(appdadi, text="dado da 21").pack()
tira100=Button(appdadi, text="dado da 100").pack()
risdado=Label(appdadi, text="--------")
risdado.pack(anchor=S)