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

Method _run_exec_lines

IPython/core/shellapp.py:366–383  ·  view source on GitHub ↗

Run lines of code in IPythonApp.exec_lines in the user's namespace.

(self)

Source from the content-addressed store, hash-verified

364 self.shell._sys_modules_keys = set(sys.modules.keys())
365
366 def _run_exec_lines(self):
367 """Run lines of code in IPythonApp.exec_lines in the user's namespace."""
368 if not self.exec_lines:
369 return
370 try:
371 self.log.debug("Running code from IPythonApp.exec_lines...")
372 for line in self.exec_lines:
373 try:
374 self.log.info("Running code in user namespace: %s" %
375 line)
376 self.shell.run_cell(line, store_history=False)
377 except:
378 self.log.warning("Error in executing line in user "
379 "namespace: %s" % line)
380 self.shell.showtraceback()
381 except:
382 self.log.warning("Unknown error in handling IPythonApp.exec_lines:")
383 self.shell.showtraceback()
384
385 def _exec_file(self, fname, shell_futures=False):
386 try:

Callers 1

init_codeMethod · 0.95

Calls 4

debugMethod · 0.80
infoMethod · 0.80
run_cellMethod · 0.45
showtracebackMethod · 0.45

Tested by

no test coverage detected