TIming

Tim Roberts timr at probo.com
Tue May 30 00:34:03 EDT 2006


WIdgeteye <None at none.none> wrote:
>HI,
>I am trying to write a little program that will run a program on
>scedule. I am having trouble understanding the datetime, time, sched
>modules. What I would like is something like this:
>
>If date&time = 06-13-2006:18:00:00
>Then run this program
>
>I am not sure how to enter a future date in this equation using any 
>of the modules mentioned above. I have figured out how to get the date 
>and time from the modules above but not the future and then compare 
>the two.

What operating system are you using?  Both Linux and Windows have commands
that can do this for you.  It's more efficient to use existing operating
system services than to invent your own.

Also, remember to take into account the possibility that your program might
not check the time at the exact second.  In your example, you need to be
prepared to start your app if the time is just PAST 6 PM on June 13.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list