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

Method _run_exec_lines

IPython/core/shellapp.py:307–324  ·  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

305 sys.stderr.flush()
306
307 def _run_exec_lines(self):
308 """Run lines of code in IPythonApp.exec_lines in the user's namespace."""
309 if not self.exec_lines:
310 return
311 try:
312 self.log.debug("Running code from IPythonApp.exec_lines...")
313 for line in self.exec_lines:
314 try:
315 self.log.info("Running code in user namespace: %s" %
316 line)
317 self.shell.run_cell(line, store_history=False)
318 except:
319 self.log.warning("Error in executing line in user "
320 "namespace: %s" % line)
321 self.shell.showtraceback()
322 except:
323 self.log.warning("Unknown error in handling IPythonApp.exec_lines:")
324 self.shell.showtraceback()
325
326 def _exec_file(self, fname, shell_futures=False):
327 try:

Callers 1

init_codeMethod · 0.95

Calls 4

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

Tested by

no test coverage detected