G
grocery_stocker
Given the following...
[cdalten@localhost oakland]$ more basic.py
#!/usr/bin/python
import sched
import time
scheduler = sched.scheduler(time.time, time.sleep)
def print_event(name):
print 'EVENT:', time.time(), name
print 'START:', time.time()
scheduler.enter(2, 1, print_event, ('first',))
scheduler.run()
[cdalten@localhost oakland]$ ./basic.py
START: 1240584506.06
EVENT: 1240584508.06 first
[cdalten@localhost oakland]$
How do I modify it so that it runs every hour on the hour.
[cdalten@localhost oakland]$ more basic.py
#!/usr/bin/python
import sched
import time
scheduler = sched.scheduler(time.time, time.sleep)
def print_event(name):
print 'EVENT:', time.time(), name
print 'START:', time.time()
scheduler.enter(2, 1, print_event, ('first',))
scheduler.run()
[cdalten@localhost oakland]$ ./basic.py
START: 1240584506.06
EVENT: 1240584508.06 first
[cdalten@localhost oakland]$
How do I modify it so that it runs every hour on the hour.