| Store | Cart

mysteriously nonfunctioning script - very simple

From: Sean McIlroy <sean...@yahoo.com>
26 Mar 2005 10:47:25 -0800
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)    
## CHECK THE CURRENT TIME EVERY 3 SECONDS, AND IF IT'S NOT BETWEEN
## 7AM AND 8AM, GO BACK TO SLEEP FOR ANOTHER 3 SECONDS

## CONTROL NEVER REACHES THIS POINT
######################################################################










Peter Hansen <peter at engcorp.com> wrote in message news:<cc-dnRzPu75e0NjfRVn-tg at powergate.ca>...
> Sean McIlroy wrote:> > Can anybody help me make sense of the fact that the following script> > doesn't work? It's so simple I can't imagine what I'm missing. Any> > help will be much appreciated.> > Always post actual tracebacks of the problem, if> indeed it is producing a traceback.  Do this always> by *cut and paste*, not by retyping the text.  Make> sure not to remove anything important, and make sure> you are running the actual code you have posted here.> > Also always describe the problem in more detail than> just "doesn't work".  For all we know, the code runs> fine but its output just doesn't suit you...> > -Peter

Recent Messages in this Thread
Sean McIlroy Mar 26, 2005 06:13 am
Piet van Oostrum Mar 26, 2005 11:12 am
Peter Hansen Mar 26, 2005 11:55 am
Sean McIlroy Mar 26, 2005 06:47 pm
Diez B. Roggisch Mar 26, 2005 07:01 pm
Peter Otten Mar 26, 2005 07:19 pm
Michael Spencer Mar 26, 2005 07:41 pm
Heiko Wundram Mar 26, 2005 08:52 pm
Sean McIlroy Mar 27, 2005 07:41 pm
Greg Ewing Mar 31, 2005 04:04 am
Messages in this thread

Previous post: Embedding Python
Next post: Embedding Python