← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #251118]: How to run a series of scripts to avoid startup splash screen with each script

 

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

Shengyuan Gu proposed the following answer:
Hi all,
My approach to hide the splash screen is using jython to run the sikuli scripts without sikuli ide.

I wrapped a jython startup script name jython.bat on windows7 using the jython in sikulix.jar:
@echo off
chcp 437
java -Xmx512m -Xss1152k -cp D:/SikuliX110b2/sikulix.jar org.python.util.jython %*

Then I can use jython to run the sikuli script without splash screen:
jython login.sikuli/login.py

also, I should insert some workaround jython code in my sikuli script:
# configure execution environment for both SikuliX and Jython
# caution:!!!
# 1, __file__ is not supported in SikuliX script, so use sys.argv[0] instead
# 2, these code cannot be move to a common module
file =  sys.argv[0]
file = file.replace('\\', '/')
fullpath = os.path.realpath(file)
fullpath = fullpath.replace('\\', '/')

# jython: xxxx.sikuli/demo.py
if file.endswith(".py") and not "robot" in file:
    # set bundle path
    pathname = os.path.dirname(fullpath)
    setBundlePath(pathname)
    print(getBundlePath())
    resetImagePath()

Hope this will be helpful.

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