I'm trying to use jep to launch python functions/instructions in my java code.
I have installed jep on Ubuntu as shown on the github page.
When I try to launch the program below on the Intellinj ide, I get nothing except this message "Process finished with exit code 0".
Here is the code I run :
public static void main(String[] args) throws JepException {
StringBuilder script = new StringBuilder();
script.append("a = 'Passed'\n");
script.append("b = 'Failed'\n");
script.append("result = max(a,b)");
try (Interpreter interp = new SharedInterpreter()) {
interp.exec(script.toString());
interp.exec("print('toto')");
String result = interp.getValue("result", String.class);
if (!"Passed".equals(result)) {
throw new IllegalStateException(
"multi-line exec returned " + result);
}
}
}
For information, I am using Java 1.8 and Python 3.6.