implementing a timer?

Aahz Maruch aahz at panix.com
Fri Dec 21 01:14:31 EST 2001


In article <9vn0gv$ll6$1 at colo.mobo-it.nl>, waalp <waalp at pissed.co.uk> wrote:
>
>I'm trying to make a script that will check if i have mail every let's say
>10 minutes.So i tought let's use something like a timer. But i can't find
>any documentation on how to implement something like this.
>
>I'm a beginner so it could be that i haven't looked in the right places.
>Could somebody please help?

Now that everyone has given you Python-based answers, let me suggest
that you may be looking in the wrong direction.  For things like this, it
frequently works better to use the scheduling capabilities of your OS.
For Unix boxen, that means cron.  Don't remember what it is for Windoze.

The main problem with solutions based on time.sleep() is that if you
want to cleanly kill the application, you have to wait for the sleep
interval to expire.  That can be rather messy.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

Tenth Virtual Anniversary: 11 days and counting



More information about the Python-list mailing list