| java.lang.Object org.python.util.PythonInterpreter org.python.util.InteractiveInterpreter org.python.util.InteractiveConsole
All known Subclasses: org.python.util.ReadlineConsole, org.python.util.JLineConsole,
Method Summary | |
public static String | getDefaultBanner() | public void | interact() Closely emulate the interactive Python console. | public void | interact(String banner) | public boolean | push(String line) Push a line to the interpreter.
The line should not have a trailing newline; it may have internal
newlines. | public String | raw_input(PyObject prompt) Write a prompt and read a line.
The returned line does not include the trailing newline. |
CONSOLE_FILENAME | final public static String CONSOLE_FILENAME(Code) | | |
InteractiveConsole | public InteractiveConsole()(Code) | | |
InteractiveConsole | public InteractiveConsole(PyObject locals, String filename, boolean replaceRawInput)(Code) | | Parameters: replaceRawInput - -if true, we hook this Class's raw_input into the builtinstable so that clients like cmd.Cmd use it. |
getDefaultBanner | public static String getDefaultBanner()(Code) | | |
interact | public void interact()(Code) | | Closely emulate the interactive Python console.
The optional banner argument specifies the banner to print before the
first interaction; by default it prints "Jython on ".
|
push | public boolean push(String line)(Code) | | Push a line to the interpreter.
The line should not have a trailing newline; it may have internal
newlines. The line is appended to a buffer and the interpreter's
runsource() method is called with the concatenated contents of the buffer
as source. If this indicates that the command was executed or invalid,
the buffer is reset; otherwise, the command is incomplete, and the buffer
is left as it was after the line was appended. The return value is 1 if
more input is required, 0 if the line was dealt with in some way (this is
the same as runsource()).
|
raw_input | public String raw_input(PyObject prompt)(Code) | | Write a prompt and read a line.
The returned line does not include the trailing newline. When the user
enters the EOF key sequence, EOFError is raised.
The base implementation uses the built-in function raw_input(); a
subclass may replace this with a different implementation.
|
|
|