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.close();
}
}
python
from java.util import ArrayList
list = ArrayList()
list.add("Hello")
list.add("World")
for item in list:
print(item)