I want to get a random number (in "boucle") all the time i press the button, but when i do it, it gives me the same number
def boucledef(boucle=random.randint(0,10)):
global copienom, listprob
if boucle>0:
nom=selectRandom(listprob)
while copienom == nom:
nom=selectRandom(listprob)
copienom=nom
global myLabel
if boucle >1:
delete_label()
myLabel = Label(root, text=nom, font=("Arial",20), bg = couleur_bg, fg = "#2C2E75")
myLabel.pack(pady=10)
if boucle ==1:
delete_label()
myLabel = Label(root, text=nom+" is choosen", font=("Arial",20), bg = couleur_bg, fg = "#2C2E75")
myLabel.pack(pady=10)
DeleteButton["state"]=NORMAL
file_menu.entryconfig("New", state="normal")
listprob=[]
root.after(1000,boucledef, boucle-1)