ANSWERED: event/job scheduling
john peter
neuzhoundxx at yahoo.com
Wed Feb 22 21:33:22 EST 2006
about further investigation, i figured the basic answer out. gosh, i love python! :-)
import sched, time
def print_time():
print "From print_time", time.time()
if __name__ == '__main__':
s = sched.scheduler(time.time, time.sleep)
fmt = '%Y-%m-%d-%H:%M'
print time.time()
s.enterabs(time.mktime(time.strptime('2006-02-22-21:15', fmt)), 1, print_time, ())
s.enterabs(time.mktime(time.strptime('2006-02-22-21:17', fmt)), 1, print_time, ())
s.enterabs(time.mktime(time.strptime('2006-02-22-21:19', fmt)), 1, print_time, ())
s.run()
print time.time()
john peter <neuzhoundxx at yahoo.com> wrote: i'd like to do the following kind of event/job scheduling:
run some task(s) (python code) everyday at (say) 8am for (say) a week.
i need to do this for both windows xp and suse linux machines. although i know
that i can use cron or its equivalent in windows to kick off the python interpreter,
i was kinda hoping python has a builtin mechanism i can use for both OSes.
can python's scheduler class do the job? if so, can someone share some code
snippets (it's not clear to me from reading the docs if python's scheduler class
can do the job).
if python's scheduler class cannot do the job, can someone recommend a third-party software/library that can do the job? thanks for any help!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060222/154d7a83/attachment.html>
More information about the Python-list
mailing list