run the pre-flight code, specified via exec_lines
(self)
| 286 | self.log.warning("Unknown error in loading extensions:", exc_info=True) |
| 287 | |
| 288 | def init_code(self): |
| 289 | """run the pre-flight code, specified via exec_lines""" |
| 290 | self._run_startup_files() |
| 291 | self._run_exec_lines() |
| 292 | self._run_exec_files() |
| 293 | |
| 294 | # Hide variables defined here from %who etc. |
| 295 | if self.hide_initial_ns: |
| 296 | self.shell.user_ns_hidden.update(self.shell.user_ns) |
| 297 | |
| 298 | # command-line execution (ipython -i script.py, ipython -m module) |
| 299 | # should *not* be excluded from %whos |
| 300 | self._run_cmd_line_code() |
| 301 | self._run_module() |
| 302 | |
| 303 | # flush output, so itwon't be attached to the first cell |
| 304 | sys.stdout.flush() |
| 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.""" |
no test coverage detected