#๐ countdown fuction repeating itself when i click too much
28 messages ยท Page 1 of 1 (latest)
@midnight horizon
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
what do you mean doubling??
the function doubles itself
everytime i call it
with the button
i can share the code with u
if you want
what happens when you click on start, code wise?
def update_time_pomodoro(self):
if self.pomodorosecs != 0 and self.startpausepomodoro:
self.pomodorosecs -=1
self.listoftimers[self.current_tab].set(f"{self.pomodorosecs//60:02d}:{self.pomodorosecs%60:02d}")
print(self.pomodorosecs)
self.after(1000,self.update_time_pomodoro)
elif self.pomodorosecs == 0:
self.switch_tab()
def pause_time_pomodoro(self):
self.startpausepomodoro = False
self.listofbuttons[self.current_tab].config(command=self.start_time_pomodoro, text="Start")
def start_time_pomodoro(self):
if not self.startpausepomodoro:
self.startpausepomodoro = True
self.listofbuttons[self.current_tab].config(command=self.pause_time_pomodoro, text="Pause")
self.update_time_pomodoro()
this will be nice
alright
Try just reordering when self.startpausepomodoro is set.
def pause_time_pomodoro(self):
self.listofbuttons[self.current_tab].config(command=self.start_time_pomodoro, text="Start")
self.startpausepomodoro = False
and then the same for start_time_pomodoro.
ohh
thank you alot
Idk if that would help. That was just my intuition. I tried to rationalize it in a second comment and realized that I'm too tired to think.
yea i still got the bug unfortunately
Damn, ok, nvm.
being called twice possibly?
@midnight horizon can you check that the timer stops when you click the Pause button?
I originally thought that this was due to multiple timers being started due to the mishandling of the startpausepomodoro flag, but now that I'm looking at the code again, that doesn't seem possible.
It does
The seconds stopped
In the vid
When i click pause
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.