import org.python.util.PythonInterpreter; import org.python.core.*; public class PyInJava{ public static void main(String []args) throws PyException { PythonInterpreter P = new PythonInterpreter(); P.exec("import sys"); P.set("a", new PyInteger(10)); P.set("b", new PyFloat(32.0)); P.exec("s=a+b"); P.exec("print s"); PyObject x = P.get("s"); System.out.println("Summe: "+x); } }