Reputation: 5148
I want to track time in python in order to rerun the model in 1 week of time. I could use:
import threading
def learn_model():
#stuff goes here
p = threading.Timer(604800, learn_model)
Will this repeat p after 1 week?
Upvotes: 0
Views: 69
Reputation: 10520
In order for that code to run at all you need to add:
p.start()
So you have
import threading
def learn_model():
#stuff goes here
p = threading.Timer(604800, learn_model)
p.start()
Then the code in learn_model will execute after a week. But, it will only run once.
Upvotes: 1