readline.read_init_file()

readline.read_init_file([filename]) Execute a readline initialization file. The default filename is the last filename used. This calls rl_read_init_file() in the underlying library.

readline.get_line_buffer()

readline.get_line_buffer() Return the current contents of the line buffer (rl_line_buffer in the underlying library).

readline.get_history_length()

readline.get_history_length() readline.set_history_length(length) Set or return the desired number of lines to save in the history file. The write_history_file() function uses this value to truncate the history file, by calling history_truncate_file() in the underlying library. Negative values imply unlimited history file size.

readline.redisplay()

readline.redisplay() Change what’s displayed on the screen to reflect the current contents of the line buffer. This calls rl_redisplay() in the underlying library.

readline.parse_and_bind()

readline.parse_and_bind(string) Execute the init line provided in the string argument. This calls rl_parse_and_bind() in the underlying library.

readline.insert_text()

readline.insert_text(string) Insert text into the line buffer at the cursor position. This calls rl_insert_text() in the underlying library, but ignores the return value.

readline.read_history_file()

readline.read_history_file([filename]) Load a readline history file, and append it to the history list. The default filename is ~/.history. This calls read_history() in the underlying library.

readline.get_completer()

readline.get_completer() Get the completer function, or None if no completer function has been set.

readline.get_completion_type()

readline.get_completion_type() Get the type of completion being attempted. This returns the rl_completion_type variable in the underlying library as an integer.

readline.append_history_file()

readline.append_history_file(nelements[, filename]) Append the last nelements items of history to a file. The default filename is ~/.history. The file must already exist. This calls append_history() in the underlying library. This function only exists if Python was compiled for a version of the library that supports it. New in version 3.5.