Python readline Functions

EditRocket provides the following information on readline functions in the Python source code builder.

add_history(line) - Append a line to the history buffer, as if it was the last line typed.

clear_history() - Clear the current history.

get_begidx() - Get the beginning index of the readline tab-completion scope.

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

get_completer_delims() - Get the readline word delimiters for tab-completion.

get_current_history_length() - Return the number of lines currently in the history.

get_endidx() - Get the ending index of the readline tab-completion scope.

get_history_item(index) - Return the current contents of history item at index.

get_history_length() - Return the desired length of the history file.

get_line_buffer() - Return the current contents of the line buffer.

insert_text(string) - Insert text into the command line.

parse_and_bind(string) - Parse and execute single line of a readline init file.

read_history_file([filename]) - Load a readline history file.

read_init_file([filename]) - Parse a readline initialization file.

redisplay() - Change what's displayed on the screen to reflect the current contents of the line buffer.

remove_history_item(pos) - Remove history item specified by its position from the history.

replace_history_item(pos, line) - Replace history item specified by its position with the given line.

set_completer([function]) - Set or remove the completer function.

set_completer_delims(string) - Set the readline word delimiters for tab-completion.

set_history_length(length) - Set the number of lines to save in the history file.

set_pre_input_hook([function]) - Set or remove the pre_input_hook function.

set_startup_hook([function]) - Set or remove the startup_hook function.

write_history_file([filename]) - Save a readline history file.