Question:
i’d tried to use root.after_cancel(AFTER), but i dont know how.Answer:
It’s hard to guess what actually you are after, but … below working code which outputs to stdout and is able to start/stop/restart the countdown with pressing the[Countdown]
button. The ‘trick’ is to run the timer all the time checking a value of a global variable, where pressing the button sets the value of that variable depending on what value it currently has. The way the code works appears to be an answer to both of your questions (1. how to stop and 2. how to reset the countdown by pressing the same button with which the countdown was started).If you have better answer, please add a comment about this, thank you!