You embed jython and you will use some Python-Modules somewere:
if you want to set the path (sys.path) in your Java-Code :
public void init() {
interp = new PythonInterpreter(null, new PySystemState());
PySystemState sys = Py.getSystemState();
sys.path.append(new PyString(rootPath));
sys.path.append(new PyString(modulesDir));
}
Py is in org.python.core.
rootPath and modulesDir is where YOU want !
let rootPath point where you located the standard-jython-lib
Have a look at src/org/python/util/PyServlet.java in the Jython-Source-Code for example
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…