|
1 | 1 | # sikulix4python
|
2 | 2 | Use SikuliX from real Python via py4j
|
| 3 | + |
| 4 | +**under development -- no guarentee for anything :-)** |
| 5 | + |
| 6 | +... but you might post issues (questions, bugs, ideas, requests, ...) |
| 7 | + |
| 8 | +**What you need** |
| 9 | + - the latest 1.1.4 sikulixapi.jar () |
| 10 | + - a Python installation 2.7 up to 3.7 (3.7 recommended) |
| 11 | + - a mature Python IDE (I use IntelliJ's PyCharm) or just a Python REPL. |
| 12 | + |
| 13 | +**How to test** |
| 14 | + |
| 15 | +Currently it is recommended, to fork this project and work in the project context. |
| 16 | + |
| 17 | +But this should also be possible: |
| 18 | + - copy the folder ``sikulix4python`` from inside the project to a place, where your Python will find it, when imported |
| 19 | + |
| 20 | +In both cases: |
| 21 | + - put ``from sikulix4phyton import *`` at the beginning of your test script |
| 22 | + - use stuff from ``sxundotted`` just as is |
| 23 | + - use stuff from ``sxclasses`` to access features of the SikuliX API classes like Region, Screen, Location ... |
| 24 | + |
| 25 | +Currently you have to look into the Python files, to find out, what is possible. |
| 26 | + |
| 27 | +**How is the SikuliX Java API accessed from Python** |
| 28 | + |
| 29 | +Before running Python scripts this way, you have to start a SikuliX server instance manually: |
| 30 | + |
| 31 | +``java -jar path-to/sikulixapi.jar pythonserver`` |
| 32 | + |
| 33 | +When you see this in the terminal window, it is running: |
| 34 | + |
| 35 | +``` |
| 36 | +März 15, 2019 10:26:20 VORM. py4Java.GatewayServer fireServerStarted |
| 37 | +INFO: Gateway Server Started |
| 38 | +``` |
| 39 | + |
| 40 | +**What is the plan** |
| 41 | + - have the complete official SikuliX API with docs available at time of script development (autocomplete, docs, help, ...) |
| 42 | + - be able to additionally access every public method from the SikuliX Java API (you must know the method signature) |
| 43 | + - have a handy solution for handling image path's of imported scripts/modules |
| 44 | + - run existing SikuliX scripts without changes (... but there will surely be exceptions) |
| 45 | + |
| 46 | +**Things you should be aware off** |
| 47 | +- you might get any problem at any time, since the current state is ``proof of concept`` |
| 48 | +- anything might be changed at any time without notice |
| 49 | +- errors and warnings you get in the terminal window can be ignored, as long as it works as intended on the Python side |
| 50 | +- output coming from the SikuliX Java API is currently only going to the terminal window |
0 commit comments