f | |
| :mod:`readline` --- GNU readline interface |
| ========================================== |
| |
| .. module:: readline |
| :platform: Unix |
| :synopsis: GNU readline support for Python. |
n | .. sectionauthor:: Skip Montanaro <skip@mojam.com> |
n | .. sectionauthor:: Skip Montanaro <skip@pobox.com> |
| |
| |
| The :mod:`readline` module defines a number of functions to facilitate |
| completion and reading/writing of history files from the Python interpreter. |
| This module can be used directly or via the :mod:`rlcompleter` module. Settings |
| made using this module affect the behaviour of both the interpreter's |
| interactive prompt and the prompts offered by the :func:`raw_input` and |
| :func:`input` built-in functions. |
| |
| .. function:: get_completer() |
| |
| Get the completer function, or ``None`` if no completer function has been set. |
| |
| .. versionadded:: 2.3 |
| |
| |
n | .. function:: get_completion_type() |
| |
| Get the type of completion being attempted. |
| |
| .. versionadded:: 2.6 |
| |
| .. function:: get_begidx() |
| |
| Get the beginning index of the readline tab-completion scope. |
| |
| |
| .. function:: get_endidx() |
| |
| Get the ending index of the readline tab-completion scope. |
| |
| Set the readline word delimiters for tab-completion. |
| |
| |
| .. function:: get_completer_delims() |
| |
| Get the readline word delimiters for tab-completion. |
| |
t | .. function:: set_completion_display_matches_hook([function]) |
| |
| Set or remove the completion display function. If *function* is |
| specified, it will be used as the new completion display function; |
| if omitted or ``None``, any completion display function already |
| installed is removed. The completion display function is called as |
| ``function(substitution, [matches], longest_match_length)`` once |
| each time matches need to be displayed. |
| |
| .. versionadded:: 2.6 |
| |
| .. function:: add_history(line) |
| |
| Append a line to the history buffer, as if it was the last line typed. |
| |
| |
| .. seealso:: |
| |