I have a button that executes a function (in tkinter). Let's say it adds money in a video game. So when you press that button, you get 100 dollars. However, I only want my user to be able to add 100 dollars once per minute. Is there a way to only allow a function to be called once a minute? (maybe with the time module or something?)
The most i know about managing time in a function is this, I would like to do something along these lines:
def add_money():
money = money + 100
app.after(5000, add_money)
I know that this function would obviously not get what i want. Is there a way to implement it so that if you clicked the button and a minute had not passed, the program would do nothing?
Thanks in advance