PyDocs

Nav

Custom Python Interpreters

interact

code

function (source)
  • interact(banner=None, readfunc=None, local=None, exitmsg=None, local_exit=False)
Closely emulate the interactive Python interpreter.

This is a backwards compatible interface to the InteractiveConsole
class.  When readfunc is not specified, it attempts to import the
readline module to enable GNU readline if it is available.

Arguments (all optional, all default to None):

banner -- passed to InteractiveConsole.interact()
readfunc -- if not None, replaces InteractiveConsole.raw_input()
local -- passed to InteractiveInterpreter.__init__()
exitmsg -- passed to InteractiveConsole.interact()
local_exit -- passed to InteractiveConsole.__init__()
Changed in 3.6, 3.13
  • 3.6: Added exitmsg parameter.
  • 3.13: Added local_exit parameter.
0 Examples
No examples for code/interact.
See Also
No see-alsos for code/interact
0 Notes
No notes for interact