Package io.deephaven.engine.util
Class PythonEvaluatorJpy
java.lang.Object
io.deephaven.engine.util.PythonEvaluatorJpy
- All Implemented Interfaces:
PythonEvaluator
The sole implementation of the
PythonEvaluator
, using Jpy to create a cpython interpreter instance inside of
our JVM.
Each evaluator has their own copy of the globals.-
Method Summary
Modifier and TypeMethodDescriptionvoid
evalScript
(String s) Evaluate the provided statements.void
Evaluate the provided statement.Gets the Python interpreter version string.getScope()
void
Runs a Python script.void
Sets the variable within our session.static PythonEvaluatorJpy
static PythonEvaluatorJpy
-
Method Details
-
withGlobalCopy
public static PythonEvaluatorJpy withGlobalCopy() throws IOException, InterruptedException, TimeoutException -
withGlobals
public static PythonEvaluatorJpy withGlobals() throws IOException, InterruptedException, TimeoutException -
getScope
-
evalStatement
Description copied from interface:PythonEvaluator
Evaluate the provided statement. Not suitable for use with scripts; because multiple statements will be ignored.- Specified by:
evalStatement
in interfacePythonEvaluator
- Parameters:
s
- the string to evaluate
-
evalScript
Description copied from interface:PythonEvaluator
Evaluate the provided statements. If you've got a multi-line script; you must use this version.- Specified by:
evalScript
in interfacePythonEvaluator
- Parameters:
s
- the string to evaluate
-
runScript
Description copied from interface:PythonEvaluator
Runs a Python script.- Specified by:
runScript
in interfacePythonEvaluator
- Parameters:
scriptFile
- the file to execute- Throws:
FileNotFoundException
- if scriptFile was not found
-
getPythonVersion
Description copied from interface:PythonEvaluator
Gets the Python interpreter version string.- Specified by:
getPythonVersion
in interfacePythonEvaluator
- Returns:
- The Python interpreter version string.
-
set
Description copied from interface:PythonEvaluator
Sets the variable within our session.- Specified by:
set
in interfacePythonEvaluator
- Parameters:
name
- the name of the variable to set.value
- the value of the variable.
-