MCPcopy Index your code
hub / github.com/ipython/ipython / interact

Method interact

IPython/terminal/interactiveshell.py:1005–1019  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1003 rl_next_input = None
1004
1005 def interact(self):
1006 self.keep_running = True
1007 while self.keep_running:
1008 print(self.separate_in, end='')
1009
1010 try:
1011 code = self.prompt_for_code()
1012 except EOFError:
1013 if (not self.confirm_exit) \
1014 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'):
1015 self.ask_exit()
1016
1017 else:
1018 if code:
1019 self.run_cell(code, store_history=True)
1020
1021 def mainloop(self):
1022 # 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