I want to create multiple timers in a loop. When the loop terminates, there should be multiple timers running. If any of the timers times out, it should call another function. How do I implement this in Python? Any help will be appreciated.
eg.
for i in (0,6):
do something
start timer_i
for i in (0,6):
if timer_i times out:
call another function
Look into
Timer
, which is locate in thethreading
module of the python standard library. The documentation gives the following example: