Package com.illumon.iris.db.util
Class PythonEvaluatorJpy
java.lang.Object
com.illumon.iris.db.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 TypeMethodDescriptionvoidevalScript(String s) Evaluate the provided statements.voidEvaluate the provided statement.Gets the Python interpreter version string.getScope()voidRuns a Python script.voidSets the variable within our session.static PythonEvaluatorJpy
-
Method Details
-
withGlobalCopy
-
getScope
-
evalStatement
Description copied from interface:PythonEvaluatorEvaluate the provided statement. Not suitable for use with scripts; because multiple statements will be ignored.- Specified by:
evalStatementin interfacePythonEvaluator- Parameters:
s- the string to evaluate
-
evalScript
Description copied from interface:PythonEvaluatorEvaluate the provided statements. If you've got a multi-line script; you must use this version.- Specified by:
evalScriptin interfacePythonEvaluator- Parameters:
s- the string to evaluate
-
runScript
Description copied from interface:PythonEvaluatorRuns a Python script.- Specified by:
runScriptin interfacePythonEvaluator- Parameters:
scriptFile- the file to execute- Throws:
FileNotFoundException- if scriptFile was not found
-
getPythonVersion
Description copied from interface:PythonEvaluatorGets the Python interpreter version string.- Specified by:
getPythonVersionin interfacePythonEvaluator- Returns:
- The Python interpreter version string.
-
set
Description copied from interface:PythonEvaluatorSets the variable within our session.- Specified by:
setin interfacePythonEvaluator- Parameters:
name- the name of the variable to set.value- the value of the variable.
-