Sean McIlroy wrote:

> Fair enough. Here's the verbose version:

> from time import sleep,time,localtime
> 
> wakeuptime = (7,00)
> ## I WANT TO BE WOKEN UP AT 7AM (FOR EXAMPLE)
> 
> onehourlater = (wakeuptime[0]+1, wakeuptime[1])
> ## ONE HOUR LATER THAN THAT IS 8AM
> 
> while not wakeuptime < localtime(time())[3:5] < onehourlater: sleep(3)

Maybe you are a little /impatient/ and want to change the above to

while not wakeuptime <= localtime(time())[3:5] < onehourlater: sleep(3)

That should wake you up roughly one minute earlier, and thus before you hit
Ctrl+C ...again. 

Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to