run the pre-flight code, specified via exec_lines
(self)
| 344 | self.log.warning("Unknown error in loading extensions:", exc_info=True) |
| 345 | |
| 346 | def init_code(self): |
| 347 | """run the pre-flight code, specified via exec_lines""" |
| 348 | self._run_startup_files() |
| 349 | self._run_exec_lines() |
| 350 | self._run_exec_files() |
| 351 | |
| 352 | # Hide variables defined here from %who etc. |
| 353 | if self.hide_initial_ns: |
| 354 | self.shell.user_ns_hidden.update(self.shell.user_ns) |
| 355 | |
| 356 | # command-line execution (ipython -i script.py, ipython -m module) |
| 357 | # should *not* be excluded from %whos |
| 358 | self._run_cmd_line_code() |
| 359 | self._run_module() |
| 360 | |
| 361 | # flush output, so itwon't be attached to the first cell |
| 362 | sys.stdout.flush() |
| 363 | sys.stderr.flush() |
| 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.""" |
no test coverage detected