MCPcopy Create free account
hub / github.com/ipython/ipython / interact

Method interact

IPython/terminal/interactiveshell.py:537–555  ·  view source on GitHub ↗
(self, display_banner=DISPLAY_BANNER_DEPRECATED)

Source from the content-addressed store, hash-verified

535 rl_next_input = None
536
537 def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED):
538
539 if display_banner is not DISPLAY_BANNER_DEPRECATED:
540 warn('interact `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2)
541
542 self.keep_running = True
543 while self.keep_running:
544 print(self.separate_in, end='')
545
546 try:
547 code = self.prompt_for_code()
548 except EOFError:
549 if (not self.confirm_exit) \
550 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'):
551 self.ask_exit()
552
553 else:
554 if code:
555 self.run_cell(code, store_history=True)
556
557 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
558 # An extra layer of protection in case someone mashing Ctrl-C breaks

Callers 4

mainloopMethod · 0.95
mainloopMethod · 0.80
test_methodFunction · 0.80

Calls 4

prompt_for_codeMethod · 0.95
ask_exitMethod · 0.95
ask_yes_noMethod · 0.80
run_cellMethod · 0.45

Tested by 1

test_methodFunction · 0.64