This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
An abstract base class for console-type widgets.
An abstract base class for console-type widgets. This class has functionality for:
- Maintaining a prompt and editing region
- Providing the traditional Unix-style console keyboard shortcuts
- Performing tab completion
- Paging text
- Handling ANSI escape codes
ConsoleWidget also provides a number of utility methods that will be convenient to implementors of a console-style widget.
Create a ConsoleWidget.
parent : QWidget, optional [default None]
Returns whether text can be copied to the clipboard.
Returns whether text can be cut to the clipboard.
Returns whether text can be pasted from the clipboard.
Change the font size by the specified amount (in points).
Clear the console.
keep_input : bool, optional (default True)
Copy the currently selected text to the clipboard.
Copy anchor text to the clipboard
Copy the currently selected text to the clipboard and delete it if it’s inside the input buffer.
Reimplemented to ensure a console-like behavior in the underlying text widgets.
Executes source or the input buffer, possibly prompting for more input.
source : str, optional
hidden : bool, optional (default False)
interactive : bool, optional (default False)
A boolean indicating whether the source was executed.
Shows a dialog to export HTML/XML in various formats.
The base font being used by the ConsoleWidget.
The text that the user has entered entered at the current prompt.
If the console is currently executing, the text that is executing will always be returned.
Open selected anchor in the default webbrowser
Paste the contents of the clipboard into the input region.
mode : QClipboard::Mode, optional [default QClipboard::Clipboard]
Print the contents of the ConsoleWidget to the specified QPrinter.
Moves the prompt to the top of the viewport.
Redo the last operation. If there is no operation to redo, nothing happens.
Sets the font to the default fixed-width font for this platform.
Selects all the text in the buffer.
Reimplemented to suggest a size that is 80 characters wide and 25 lines high.
The width (in terms of space characters) for tab characters.
Undo the last operation. If there is no operation to undo, nothing happens.
Get common prefix for completions
Return the longest common prefix of a list of strings, but with special treatment of escape characters that might precede commands in IPython, such as %magic functions. Used in tab completion.
For a more general function, see os.path.commonprefix
Returns whether the specified unicode character is a letter or a number.