I'm making some kind of cookie clicker game with Tkinter to practise my Python skills.
This is my code so far:
""" author: Elxas866 file: BubbleClicker.py descr.: A cookie clicker-like game """ from tkinter import * from PIL import ImageTk, Image clicks = 0 def counter(): global clicks clicks += 1 print(clicks) def main(): root = Tk() root.minsize(500, 500) #pixels root.title("Bubble Cliker") bubble = Image.open("assets/Bubble.png") Bubble = ImageTk.PhotoImage(bubble) image = Button(image=Bubble, command=counter) image.pack() image.place(relx=0.5, rely=0.5, anchor=CENTER) score = Label(text=clicks, font=("Arial", 25)) score.pack() root.mainloop() main()#call Everything works perfectly fine, but it doesn't show my score in the label. It updates it if I print it so technically it works. But in the label it stays 0. Do you now how to fix that?
Thanks in advance!