from tkinter import * a = 0 def inc(): v = infos['value'] v += 1 infos['value'] = v can.itemconfig(text, text=str(v)) infos = {'value': a} f = Tk() can= Canvas(f, width=150, height=150) can.pack() text = can.create_text((50, 50), text=a) button = Button(f, text='incrémenter', command=inc) button.pack() f.mainloop()