PyDocs

Nav

Custom Python Interpreters

InteractiveConsole

code

class (source)
  • InteractiveConsole(locals=None, filename='<console>', *, local_exit=False)
Closely emulate the behavior of the interactive Python interpreter.

This class builds on InteractiveInterpreter and adds prompting
using the familiar sys.ps1 and sys.ps2, and input buffering.
Changed in 3.13
  • 3.13: Added local_exit parameter.
Members of InteractiveConsole

i

interact
Closely emulate the interactive Python console.

p

push
Push a line to the interpreter.

r

raw_input
Write a prompt and read a line.
resetbuffer
Reset the input buffer.
0 Examples
No examples for code/InteractiveConsole.
See Also
No see-alsos for code/InteractiveConsole
0 Notes
No notes for InteractiveConsole