← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #223076]: Sleep until specific time, or start at specific time?

 

Question #223076 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/223076

    Status: Open => Answered

RaiMan proposed the following answer:
If you want a Sikuli script to do something at a specific time of day,
you have to either use your system specific scheduler to run the script
from command line or start the script and let it wait until the specific
time, to then do the job.

wait in the script:

import datetime
# setup the time to wakeup in the future
wakeup = (datetime.datetime.today() + datetime.timedelta(1)).replace(hour=8, minute=0, second=0)

# wait until then
while True:
    wait(60) # see comment
    if datetime.datetime.today() > wakeup: break 
popup("hallo: it is" + str(wakeup))

comment: depending on how exact the wakeup has to be the wait time can
be specified. In this case the wake up would be latest tomorrow at 8:01

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.