← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #156488]: Sleep function for certain time of day

 

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

    Status: Answered => Open

Ofer W. is still having a problem:
Hi RaiMan. Thanks for taking the time to try and help!

I'm very new to Sikuli and python and programming languages in general.
so I need some further help on this.  Here's what I tried to do with the
script you posted , and the error I received:

def sleepUntil(14, 08):
 a = time.localtime()
 at = time.mktime(a)
 b = time.struct_time((a[0], a[1], a[2], h, m, s, 0, 0, a[-1]));
 bt = time.mktime(b)
 diff = bt-at
 wait(diff)
 click( )

got this:

[error] Stopped [error] An error occurs at line 1 [error] Error message:
SyntaxError: ("no viable alternative at input '14'",
('D:\\AppData\\Local\\Temp\\sikuli-tmp3683672924435265109.py', 1, 15,
'def sleepUntil(14, 11):\n'))

I also tried changing the "h,m,s" to numbers in line  b =
time.struct_time , but received similar error.

Can you put in all the correct numbers for me, say again for 14:30, so I
will be sure how the script would work.

Thanks and sorry for being such a newbie!

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