While it largely stopped being a concern after the release of Python 3.5 in September 2015, it was an entirely appropriate question prior to that, as Python 3 introduced backwards incompatible changes that more obviously helped future users of the language than they did current users, so existing users (especially library and framework developers) were being asked to devote time and effort to a transition that would cost them more in time and energy in the near term than it would save them for years to come.Since I had seen variants of these questions several times over the years, I started this FAQ as an intermittently updated record of my thoughts on the topic, with updates generally being prompted by new iterations of the questions.Buttons to start and pause the countdown will be implemented as well.The picture below demonstrates the final product: For this to work, a background countdown timer thread must be implemented.You can see the full history of changes in the source repo. While many of them are shared by other core developers, and I use “we” in several places where I believe that to be the case, I don’t claim to be writing on the behalf of every core developer on every point.Several core developers (including Guido) reviewed and offered comments on this document at various points in time, and aside from Guido noting that I was incorrect about his initial motivation in creating Python 3, none of them has raised any objections to specific points or the document in general.In that case, you must manually tell gtk to * update widgets yourself by calling g_main_context_iteration.
Here is the full code for the countdown Thread object (countdown Thread.py): Countdown timer object is inherited from Thread object, and more functionality is added.
The self.__time is total time to start the countdown from, and it should decrement every second by 1; variable self.__fulltime is used to restart the counter.
Furthermore an Event object self.__unpause is used internally for pausing/unpausing the counter.
Well, do_something(...) is defined inside on_button_clicked(...), I don't know if it's a right way to do it, but it works just fine.
Now, as I said in my first post, everything else works perfectly, but second Window never appears (third Window does, though).