I want to call Python functions in Java. I know there is Jython, which comes with the PythonInterpreter for Java, but sadly it only supports Python 2.7.
For a better explanation of what I want to do. Let's say I have the following Python code in a given file:
@staticmethod
def my_first_function():
print("Hi!")
@staticmethod
def my_second_function():
print("Hi again!")
I want to be able to EXPLICITLY call functions like this in Java now:
PythonToJava pythonToJava = new PythonToJava("my/python/script/path");
pythonToJava.my_second_function();
pythonToJava.my_first_function();
How can I use/call a Python module/script/class/etc. in Java?