grocery_stocker wrote:
Given the following...
[cdal...@localhost oakland]$ more basic.py
<snip>
How do I modify it so that it runs every hour on the hour.
I'd probably use cron, but here's one way.
Emile
-----
import sched
import time
scheduler = sched.scheduler(time.time, time.sleep)
def print_event(count,rescheduler):
print 'EVENT:', time.time(), count
rescheduler.enter(2,1,print_event,(count+1,rescheduler))
print 'START:', time.time()
scheduler.enter(2, 1, print_event, (1,scheduler))
scheduler.run()
--
http://mail.python.org/mailman/listinfo/python-list