PyDocs

Nav

Custom Python Interpreters

InteractiveConsole.interact

  • InteractiveConsole.interact(banner=None, exitmsg=None)
Closely emulate the interactive Python console.

The optional banner argument specifies the banner to print
before the first interaction; by default it prints a banner
similar to the one printed by the real Python interpreter,
followed by the current class name in parentheses (so as not
to confuse this with the real interpreter -- since it's so
close!).

The optional exitmsg argument specifies the exit message
printed when exiting. Pass the empty string to suppress
printing an exit message. If exitmsg is not given or None,
a default message is printed.
Changed in 3.4, 3.6
  • 3.4: To suppress printing any banner, pass an empty string.
  • 3.6: Print an exit message when exiting.
0 Examples
No examples for code/InteractiveConsole.interact.
See Also
No see-alsos for code/InteractiveConsole.interact
0 Notes
No notes for InteractiveConsole.interact