from threading import Timer a = 0 def TaskManager(): global a t = Timer( 1, TaskManager ) t.start() if(a == 5): t.cancel() return print("hello") a += 1 TaskManager()
from threading import Timer def TaskManager(delay_time): t = Timer( 1 , TaskManager [delay_time]) t.start() if(delay_time == 0): t.cancel() return print("hello") delay_time -= 1 TaskManager(5)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)