From 8d7b393b1bd8d5ca697e8e1b25ecb02387b7ced4 2011-12-21 10:03:02 From: MinRK Date: 2011-12-21 10:03:02 Subject: [PATCH] flush stdout/err after init_code prevents startup script/file output from being attached to the first cell of a frontend --- diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index 0e0bb20..6d90f52 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -184,6 +184,10 @@ class InteractiveShellApp(Configurable): self._run_exec_files() self._run_cmd_line_code() + # flush output, so itwon't be attached to the first cell + sys.stdout.flush() + sys.stderr.flush() + # Hide variables defined here from %who etc. self.shell.user_ns_hidden.update(self.shell.user_ns)