# readline - pydoc - phpman

Help on module readline:

## NAME
    readline - Importing this module enables command line editing using GNU readline.

## MODULE REFERENCE
    <https://docs.python.org/3.10/library/readline.html>

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

## FUNCTIONS
### add_history
        Add an item to the history buffer.

### append_history_file
        Append the last nelements items of the history list to file.

        The default filename is ~/.history.

### clear_history
        Clear the current readline history.

### get_begidx
        Get the beginning index of the completion scope.

### get_completer
        Get the current completer function.

### get_completer_delims
        Get the word delimiters for completion.

### get_completion_type
        Get the type of completion being attempted.

### get_current_history_length
        Return the current (not the maximum) length of history.

### get_endidx
        Get the ending index of the completion scope.

### get_history_item
        Return the current contents of history item at one-based index.

### get_history_length
        Return the maximum number of lines that will be written to the history file.

### get_line_buffer
        Return the current contents of the line buffer.

### insert_text
        Insert text into the line buffer at the cursor position.

### parse_and_bind
        Execute the init line provided in the string argument.

### read_history_file
        Load a readline history file.

        The default filename is ~/.history.

### read_init_file
        Execute a readline initialization file.

        The default filename is the last filename used.

### redisplay
        Change what's displayed on the screen to reflect contents of the line buffer.

### remove_history_item
        Remove history item given by its zero-based position.

### replace_history_item
        Replaces history item given by its position with contents of line.

        pos is zero-based.

### set_auto_history
        Enables or disables automatic history.

### set_completer
        Set or remove the completer function.

        The function is called as function(text, state),
        for state in 0, 1, 2, ..., until it returns a non-string.
        It should return the next possible completion starting with 'text'.

### set_completer_delims
        Set the word delimiters for completion.

### set_completion_display_matches_hook
        Set or remove the completion display function.

        The function is called as
          function(substitution, [matches], longest_match_length)
        once each time matches need to be displayed.

### set_history_length
        Set the maximal number of lines which will be written to the history file.

        A negative length is used to inhibit history truncation.

### set_pre_input_hook
        Set or remove the function invoked by the rl_pre_input_hook callback.

        The function is called with no arguments after the first prompt
        has been printed and just before readline starts reading input
        characters.

### set_startup_hook
        Set or remove the function invoked by the rl_startup_hook callback.

        The function is called with no arguments just
        before readline prints the first prompt.

### write_history_file
        Save a readline history file.

        The default filename is ~/.history.

## FILE
    /usr/lib/python3.10/lib-dynload/readline.cpython-310-x86_64-linux-gnu.so


