import org.python.util.PythonInterpreter; public class JythonExample { public static void main(String[] args) { PythonInterpreter interpreter = new PythonInterpreter(); interpreter.exec("print('Hello from Python!')"); interpreter.exec("def add(a, b): " + " return a + b"); interpreter.exec("result = add(3, 5)"); interpreter.exec("print(result)"); } }


上一篇:
下一篇:
切换中文