code: def interact(banner=None, readfunc=None, local=None):
      
      console = InteractiveConsole(local)
      if readfunc is not None:
          console.raw_input = readfunc
      else:
          try:
              import readline
          except ImportError:
              pass
      console.interact(banner)
docs: 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__()