qtconsole
qtconsole copied to clipboard
Custom banner
It used to be possible to customize the banner of RichIPythonWidget using something like:
class MyConsole(RichIPythonWidget):
banner = 'Custom banner\n'
However, if I now do:
class MyConsole(RichJupyterWidget):
banner = 'Custom banner\n'
control = MyConsole()
control.kernel_manager = kernel_manager
control.kernel_client = kernel_client
control.exit_requested.connect(stop)
control.show()
Then the output of the console is as follows:
If I add:
control._display_banner = False
Then no banner is shown at all. Is there a way to have a fully customized banner?
The second part is coming from the kernel; I don't think there's a way to disable that.
You could override the reset() method, but that would involve a bit of copy-pasting. Maybe it makes sense to pull out a display_banner() method which you could more easily override.
@takluyver - thanks! Just to check, this has changed recently though, correct? (it used to be that what was assigned to the banner attribute was the last thing shown before the prompt).
I'm not sure exactly when it changed, but probably at some point post big-split.