| 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 |