← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #252488]: making loops and adding a counter

 

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

    Status: Answered => Open

Richi is still having a problem:
Hi,

i thank you very much, i have tested the code below and it works really
well.



import time

count = 1

for i in range(4): #To run 5 times

     print "This is run number %s" %(count)

     a = time.clock()

     doubleClick("image1.png")
     wait(1)
     hover("image2.png")
     sleep(2)
     click("image3.png")
     sleep(2)
     hover("image4.png")
     click("image5.png")

     print " Run time: ",time.clock()-a,"seconds"
     print "_____________________"
     count += 1


Well, i would like to know how can i add a  log file in the above code , 
that can leave a trace after every loop? 

As such, for example , if after the 3rd loop, sikuli stops, a log file
is generated in which it states that ,at the 3rd loop, sikuli stopped.

what code lines can i add?


thank you

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