RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Table of Contents |
---|
Python scripts could be invoked from Java using different frameworks. We have done analysis on the below frameworks and finally selected JEP-Java Embedded Python framework and HTTP server for the final design and implementation. All the analysis findings of different frameworks are as follows.
Jython is an implementation of the Python programming language designed to run on the Java platform. Adding Jython on the CLASSPATH, the framework should automatically discover that we have the possibility of using this scripting engine and enable us to ask for the Python script engine directly. The below are the advantages and drawbacks of using Jython
...
The ProcessBuilder API can be used to create a native operating system process to launch python. We can create our ProcessBuilder object passing the command and argument values to the constructor. It's also important to mention the call to redirectErrorStream(true). In case of any errors, the error output will be merged with the standard output.
...
Refer this link for JEP installation and setup documentation : https://github.com/ninia/jep/wiki/Getting-Started
Using HTTP server Python projects needs to be started as a REST api server using the Python frameworks like flask or Django. If REST api are created similar to the API template provided automatics, then these API's can be invoked from automatics and there by executing the python test cases and updating the response back to automatics.
...
...
JPype is a Python module to provide full access to Java from within Python. Unlike Jython, JPype does not achieve this by re-implementing Python, but instead by interfacing both virtual machines at the native level. This shared memory based approach achieves good computing performance, while providing the access to the entirety of CPython and Java libraries. This approach allows direct memory access between the two machines, implementation of Java interfaces in Python, and even use of Java threading. JPype user guide is available in this link : https://github.com/jpype-project/jpype/blob/master/doc/userguide.rst
...