Base class for command console.
Similar to InteractiveConsole, but provides local prompt control and
hook for simple non-Python command processing.
|
|
__init__(self,
locals=None,
filename='<console>',
cmddict=None,
prompt1='>>> ',
prompt2='... ',
cmdchars=('a-zA-Z_.', '0-9'))
Constructor. |
source code
|
|
|
|
addHistory(self,
line)
Append a line to history |
source code
|
|
|
|
printHistory(self,
n=20)
Print last n lines of history |
source code
|
|
|
|
interact(self,
banner=None)
Emulate the interactive Python console, with extra commands. |
source code
|
|
|
|
cmd(self,
line)
Check for and execute commands from dictionary. |
source code
|
|
|
|
default(self,
cmd,
line,
i)
Hook to handle other commands (this version does nothing) |
source code
|
|
|
Inherited from code.InteractiveConsole:
push,
raw_input,
resetbuffer
Inherited from code.InteractiveInterpreter:
runcode,
runsource,
showsyntaxerror,
showtraceback,
write
|