This is my code for a simple Tkinter project:
from Tkinter import *
root = Tk()
global cookie_count
cookie_count = "0"
cookies = Label(root, text=cookie_count)
cookies.grid(row=0, column=0, columnspan=3)
def addCookie(multiplier):
global cookie_count
before = cookie_count
after = int(before) + (1 * multiplier)
cookie_count = after
root.update()
add = Button(root, text="Click me!", command=lambda: addCookie(1))
add.grid(row=1, column=1, columnspan=3)
root.mainloop()
How can I make it so that the cookies
label's value changes when I click the button?