MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / interact

Function interact

_pydevd_bundle/pydevconsole_code.py:517–540  ·  view source on GitHub ↗

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 t

(banner=None, readfunc=None, local=None, exitmsg=None)

Source from the content-addressed store, hash-verified

515
516
517def interact(banner=None, readfunc=None, local=None, exitmsg=None):
518 """Closely emulate the interactive Python interpreter.
519
520 This is a backwards compatible interface to the InteractiveConsole
521 class. When readfunc is not specified, it attempts to import the
522 readline module to enable GNU readline if it is available.
523
524 Arguments (all optional, all default to None):
525
526 banner -- passed to InteractiveConsole.interact()
527 readfunc -- if not None, replaces InteractiveConsole.raw_input()
528 local -- passed to InteractiveInterpreter.__init__()
529 exitmsg -- passed to InteractiveConsole.interact()
530
531 """
532 console = InteractiveConsole(local)
533 if readfunc is not None:
534 console.raw_input = readfunc
535 else:
536 try:
537 import readline
538 except ImportError:
539 pass
540 console.interact(banner, exitmsg)
541
542
543if __name__ == "__main__":

Callers 1

Calls 2

interactMethod · 0.95
InteractiveConsoleClass · 0.85

Tested by

no test coverage detected