public final class MainInterpreter
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Stop the interpreter thread.
|
static void |
setInitParams(PyConfig config)
Sets interpreter settings for the main Python interpreter.
|
static void |
setJepLibraryPath(java.lang.String path)
Sets the path of the jep native library.
|
static void |
setSharedModulesArgv(java.lang.String... argv)
Sets the sys.argv values on the main interpreter.
|
void |
sharedImport(java.lang.String module)
Import a module into the main interpreter on the correct thread for that
interpreter.
|
public void sharedImport(java.lang.String module) throws JepException
module
- the name of the module to importJepException
- if an error occurspublic void close()
close
in interface java.lang.AutoCloseable
public static void setInitParams(PyConfig config) throws JepException
config
- the python configuration to use.JepException
- if an error occurspublic static void setSharedModulesArgv(java.lang.String... argv) throws JepException
argv
- the arguments to be set on Python's sys.argv for the main
interpreterJepException
- if an error occurspublic static void setJepLibraryPath(java.lang.String path) throws JepException
System.load(String)
. This method
must be called before the first Interpreter instance is created in the
process.path
- the path of the jep native library, an absolute path leading
to a file that is often named libjep.so or libjep.dll.JepException
- if an error occurs