Alternative Python bindings for GNU Readline.
rl exports the following components:
- Interface to the readline completer. Used to configure the completion
aspects of readline.
- Interface to the active readline completion. Used to interact
with readline when a completion is in progress.
- Interface to the readline history. Used to read and write history files
and to manipulate history entries.
- The readline bindings module. Contains everything known from the standard
library plus extensions specific to the rl package. The completer,
completion, and history
objects make use of this module, and you should rarely need to interact
with it directly.
- A factory turning any callable into a completion entry function that
can be handed to readline.
- A decorator printing exceptions to stderr. Useful when writing Python
completions and hooks, as exceptions occurring there are usually
swallowed by the in-between C code.
Completion is the process initiated when the user presses the TAB key.
It has three phases: Word breaking, match generation, and
For each phase, readline provides configuration settings and hooks that
allow applications to control the way the library behaves. See the
Completer and Completion
classes for detailed descriptions of available properties.
A calling sequence for filename completion may look like this:
History allows readline to save and later recall lines the user has entered.
The history object provides a list-like interface to the
history buffer as well as functions to persist the history between sessions.