public final class Run
extends java.lang.Object
| Constructor and Description |
|---|
Run() |
| Modifier and Type | Method and Description |
|---|---|
static org.python.core.PyObject |
eval(java.lang.String code,
java.lang.String mapName,
java.lang.Object[] map,
JextFrame parent)
Evaluates some Python code.
|
static void |
execute(java.lang.String code,
JextFrame parent)
Executes some Python code.
|
static org.python.util.PythonInterpreter |
getPythonInterpreter(JextFrame parent)
Creates an interpreter.
|
static org.python.util.PythonInterpreter |
getPythonInterpreter(JextFrame parent,
Console console)
Creates an interpreter.
|
static void |
runScript(java.lang.String fileName,
JextFrame parent)
Runs a Jext script from a file.
|
static void |
setupPythonInterpreter(org.python.util.PythonInterpreter interp,
JextFrame parent,
Console console)
This method does the local setup for PythonInterpreter: on each one
you'll need to call it every time parent changes.
|
static void |
startupPythonInterpreter(org.python.util.PythonInterpreter interp)
This method does the global setup for PythonInterpreter: on each one
you'll need to call it only once.
|
public static void startupPythonInterpreter(org.python.util.PythonInterpreter interp)
public static void setupPythonInterpreter(org.python.util.PythonInterpreter interp,
JextFrame parent,
Console console)
interp - the PythonInterpreter to setupparent - the value to give to the __jext__ var; if null, output will go to Jext's
stdout and stderr(i.e. System.out and System.err)console - if null, output will go to the log window of parent; else, it will go
inside this consolepublic static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent)
parent - The window which executes the scriptpublic static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent, Console console)
parent - The window which executes the scriptconsole - public static org.python.core.PyObject eval(java.lang.String code,
java.lang.String mapName,
java.lang.Object[] map,
JextFrame parent)
code - The script code to be evaluatedmap - A map of properties to add to interpreterparent - The window which executes the scriptpublic static void execute(java.lang.String code,
JextFrame parent)
code - The script code to be interpretedparent - The window which executes the scriptpublic static void runScript(java.lang.String fileName,
JextFrame parent)
fileName - Path to the scriptparent - The Jext window which have to execute the scriptCopyright ? 2002 Romain Guy.