| java.lang.Object org.python.util.PythonInterpreter
All known Subclasses: org.python.util.InteractiveInterpreter,
PythonInterpreter | public class PythonInterpreter (Code) | | The PythonInterpreter class is a standard wrapper for a JPython
interpreter for use embedding in a Java application.
author: Jim Hugunin version: 1.0, 02/23/97 |
PythonInterpreter | public PythonInterpreter()(Code) | | Create a new Interpreter with an empty dictionary
|
PythonInterpreter | public PythonInterpreter(PyObject dict)(Code) | | Create a new interpreter with the given dictionary to use as its
namespace
Parameters: dict - the dictionary to use |
cleanup | public void cleanup()(Code) | | |
eval | public PyObject eval(String s)(Code) | | Evaluate a string as Python source and return the result
Parameters: s - the string to evaluate |
exec | public void exec(String s)(Code) | | Execute a string of Python source in the local namespace
Parameters: s - the string to execute |
exec | public void exec(PyObject code)(Code) | | Execute a Python code object in the local namespace
Parameters: code - the code object to execute |
execfile | public void execfile(String s)(Code) | | Execute a file of Python source in the local namespace
Parameters: s - the name of the file to execute |
get | public PyObject get(String name)(Code) | | Get the value of a variable in the local namespace
Parameters: name - the name of the variable |
get | public Object get(String name, Class javaclass)(Code) | | Get the value of a variable in the local namespace Value will be
returned as an instance of the given Java class.
interp.get("foo", Object.class) will return the most
appropriate generic Java object.
Parameters: name - the name of the variable Parameters: javaclass - the class of object to return |
initialize | public static void initialize(Properties preProperties, Properties postProperties, String[] argv)(Code) | | Initializes the jython runtime. This should only be called once, and
should be called before any other python objects are created (including a
PythonInterpreter).
Parameters: preProperties - A set of properties. Typically System.getProperties() is used. Parameters: postProperties - An other set of properties. Values like python.home,python.path and all other values from the registry files canbe added to this property set. PostProperties will overridesystem properties and registry properties. Parameters: argv - Command line argument. These values will assigned to sys.argv. |
set | public void set(String name, Object value)(Code) | | Set a variable in the local namespace
Parameters: name - the name of the variable Parameters: value - the value to set the variable to.Will be automatically converted to an appropriate Python object. |
set | public void set(String name, PyObject value)(Code) | | Set a variable in the local namespace
Parameters: name - the name of the variable Parameters: value - the value to set the variable to |
setOut | public void setOut(PyObject outStream)(Code) | | Set the Python object to use for the standard output stream
Parameters: outStream - Python file-like object to use as output stream |
setOut | public void setOut(java.io.Writer outStream)(Code) | | Set a java.io.Writer to use for the standard output stream
Parameters: outStream - Writer to use as output stream |
setOut | public void setOut(java.io.OutputStream outStream)(Code) | | Set a java.io.OutputStream to use for the standard output stream
Parameters: outStream - OutputStream to use as output stream |
setState | protected void setState()(Code) | | |
|
|