how to run a sikuli script in jython.exe or jython IDE

Asked by xiaocezi on 2017-11-20

Hi,

      i have a question about "how to run sikuli script in jython.exe or jython IDE"
i'm not sure it's whether can be achieved,if could achieve in this way ,please let me know how ?
i have worked with sikulix1.1.1 for 2 months and learned a lot.
but still new for the sikuli and python.
thanks very much.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
xiaocezi
Solved:
24 minutes ago
Last query:
24 minutes ago
Last reply:
2017-11-20
xiaocezi (xiaocezi) said : #1

i have readed the answer about"How we import sikuli.Sikuli.* module in python"
the page is https://answers.launchpad.net/sikuli/+question/136170
i add path in os environment like:
set JYTHONPATH=c:\Program Files\Sikuli\sikulix.jar\Lib
set CLASSPATH=c:\Program Files\Sikuli\sikulix.jar
set SIKULI="C:\Program Files\Sikuli\sikulix.jar"

but,the sikuli script in jython still not work.

xiaocezi (xiaocezi) said : #2

I've achieved to run SikuliX from Command Line in pycharm with relative path,like :
----------
import os
os.system("runsikulix.cmd -r MonkeyTest-WindowsSystem")
----------
my os is window 7.0.
and i want to know how could i run sikuli code ,like:
----------
click(“x.png”)
----------
in pycharm with python script,but a sikuli script。

i am still study in this continue.

xiaocezi (xiaocezi) said : #4

thank you very very much,Raiman!
You are a good man!
it is suprise for me!
I'll try this way in the link,and reply weather i work with it.

xiaocezi (xiaocezi) said : #5

now i had achieved to run sikuli scripts in pycharm with jython interpreter.
and achieved to run sikuli scripts in eclipse with jython interpreter, or java application.
in pycharm with jython interpreter is easy,can like this:
------------------------------------
import sys
sys.path.append("C:\\Users\\xie\\AppData\\Roaming\\Sikulix\\Lib")
from sikuli import *
from sikuli import Screen

print "Hello World!Jython"
x=1
print x

any = Screen(0)
any.click("1m.png")
-----------------------------------

the"C:\\Users\\xie\\AppData\\Roaming\\Sikulix\\Lib" directory,is a auto create file directory when i setup sikuli.

ok, my english is not so good,if has any question about it,can email me:xiejiaohu@126.com