I'm trying to make a generic countdown timer. If was GUI based, using tk.after
would do the magic, but it is not.
During given time interval, should it returns 1
when countdown in progress and 0
when it is off. This counter will run in background inside other classes (that may be GUI class).
for example, let TimeOut
be that countdown timer:
a = TimeOut(days=0,seconds=100) # a runs in background for 100 seconds.
a.status() # during countdown time - `status` returns `1`.
Is there an elegant way to create such class?