On a webserver i am currently implementing in web.py , I am using the following approach to perform an action periodically:
import threading
def periodicAction():
# do something
threading.Timer(time_interval, periodicAction).start() # when finished, wait and then start same function in a new thread
periodicAction() # start the method
While it works fine (meaning it does what it is supposed to do), I still have the problem, that when I test it from the command line, the console gets unresponsive (i can still type, but it has no affect, even ctrl + c does not stop the program). It this the normal behaviour or am I doing something wrong?