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.AutoCloseablepublic static void setInitParams(PyConfig config) throws java.lang.IllegalStateException
config - the python configuration to use.java.lang.IllegalStateException - if called after the Python interpreter is initializedpublic static void setSharedModulesArgv(java.lang.String... argv)
throws java.lang.IllegalStateException
argv - the arguments to be set on Python's sys.argv for the main
interpreterjava.lang.IllegalStateException - if called after the Python interpreter is initializedpublic static void setJepLibraryPath(java.lang.String path)
throws java.lang.IllegalStateException
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.java.lang.IllegalStateException - if called after the Python interpreter is initialized