This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: qt.console.frontend_widget

Frontend widget for the Qt Console

2 Classes

class IPython.qt.console.frontend_widget.FrontendHighlighter(frontend, lexer=None)

Bases: IPython.qt.console.pygments_highlighter.PygmentsHighlighter

A PygmentsHighlighter that understands and ignores prompts.

__init__(frontend, lexer=None)

Highlight a block of text. Reimplemented to highlight selectively.


Reimplemented to temporarily enable highlighting if disabled.

setFormat(start, count, format)

Reimplemented to highlight selectively.

class IPython.qt.console.frontend_widget.FrontendWidget(*args, **kw)

Bases: IPython.qt.console.history_console_widget.HistoryConsoleWidget, IPython.qt.base_frontend_mixin.BaseFrontendMixin

A Qt frontend for a generic Python kernel.

__init__(*args, **kw)

Appends text to the output stream.


Clears the current line of output.


Copy the currently selected text to the clipboard, removing prompts.


Copy the currently selected text to the clipboard without attempting to remove prompts or otherwise alter the text.

execute_file(path, hidden=False)

Attempts to execute file with ‘path’. If ‘hidden’, no output is shown.


If a clearoutput is pending, execute it.


Attempts to interrupt the running kernel.

Also unsets _reading flag, to avoid runtime errors if raw_input is called again.


Resets the widget to its initial state if clear parameter is True, otherwise prints a visual indication of the fact that the kernel restarted, but does not clear the traces from previous usage of the kernel before it was restarted. With clear=True, it is similar to %clear, but also re-writes the banner and aborts execution if necessary.

restart_kernel(message, now=False)

Attempts to restart the running kernel.