0
tkinter.button
hello evry body , i want try put a counter on Button with tkinter. the problem is i canno't do it ! i have always 1 in console. can you help me pleas the code : import tkinter def bouton_TC(*args): if smiley_1: cpt = cpt+1 print(cpt) smiley_1 = tkinter.PhotoImage(file= "TC.png") button_1 = tkinter.Button(cadre, image=smiley_1, command = bouton_TC,) button_1.pack(side="left",padx=10, pady=10 )
3 Answers
0
create a global variable named cpt or counter.Out of the function.
0
thx for your reponse,
i had try this test but the console report an error :-(
0
I'm sorry.But as far as I can see understood this from your code.