I am trying to get the below method to incrementally subtract the number which is displayed as the text in the button, but cannot get it to update below 4.
def waterclick(watercount = 5):
water = watercount - 1
waterlabel.config(text = water)
print(water)
full code:
# importing whole module
from tkinter import *
from tkinter import ttk
root = Tk()
#name of the program
label = ttk.Label(root, text = '.0.')
label.grid(row = 0, column = 0)
label.config(text = "Howdy Tkinter")
label.config(foreground = 'white', background = 'black', font = ('impact', 14))
#increments water count by -1
def waterclick(watercount = 5):
water = watercount - 1
waterlabel.config(text = water)
print(water)
#water button
waterlabel = ttk.Button(root, text = 5, command = waterclick)
waterlabel.grid(row = 0, column = 1, columnspan = 2)
mainloop()