Question

I'm trying to output some debug info in a Sikuli script using print but I can see this info only after the script has finished execution because the IDE hides itself while the script is running. Is there a way to see those logs during execution? Like outputting this info to console or (better) not hiding IDE during execution?

No correct solution

OTHER TIPS

(1) You could use a pop-up:

popup("Hello World")

(2) You can use Jython's File IO

f = open("myLogfile.txt", 'a')
f.write("Log Message")
f.close()

Now if you open the log file in a text editor that warns about changes made to the file (ie NOT Notepad.exe), you can then see your print statements every time the file is appended by your script.

You cannot hide the IDE in background during script execution. However,there's an alternative to view the logs.

You can install the package which launches your sikuli via command prompt(sikuli-script.jar), refer to https://launchpad.net/raiman/+download

you won't need the IDE to launch your scripts this way.

Now after changing necessary environment settings you can type-in simple path like "java -jar %Sikuli_Home%\sikuli-script.jar -r %Sikuli_Scripts%\main.sikuli" in cmd and get started.

here 'main' is my driver script where I have imported my modules under single .sikuli folder (main.sikuli) you can have any file name like abc.sikuli

(here you need to store your path in a variable like ,path = os.environ['Sikuli_Scripts'])

Also ,it is a good practice to launch applications creating batch files and accessing files using relative path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top