Python - Uruchom funkcję w określonym czasie
Jak mogę uruchomić funkcję wPyton, w wyznaczonym czasie?
Na przykład:
run_it_at(func, '2012-07-17 15:50:00')
i uruchomi tę funkcjęfunc
o 2012-07-17 15:50:00.
Próbowałemharmonogram, ale to nie uruchomiło mojej funkcji.
import time as time_module
scheduler = sched.scheduler(time_module.time, time_module.sleep)
t = time_module.strptime('2012-07-17 15:50:00', '%Y-%m-%d %H:%M:%S')
t = time_module.mktime(t)
scheduler_e = scheduler.enterabs(t, 1, self.update, ())
Co mogę zrobić?