readline.write_history_file()

readline.write_history_file([filename]) Save the history list to a readline history file, overwriting any existing file. The default filename is ~/.history. This calls write_history() in the underlying library.

repr()

repr(object) Return a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defin

readline.set_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.set_pre_input_hook()

readline.set_pre_input_hook([function]) Set or remove the function invoked by the rl_pre_input_hook callback of the underlying library. If function is specified, it will be used as the new hook function; if omitted or None, any function already installed is removed. The hook is called with no arguments after the first prompt has been printed and just before readline starts reading input characters. This function only exists if Python was compiled for a version of the library that supports it

readline.set_completion_display_matches_hook()

readline.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. This sets or clears the rl_completion_display_matches_hook callback in the underlying library. The completion display function is called as function(substitution, [matches], longest_match_length) once each time matches need to b

readline.set_completer()

readline.set_completer([function]) Set or remove the completer function. If function is specified, it will be used as the new completer function; if omitted or None, any completer function already installed is removed. The completer function is called as function(text, state), for state in 0, 1, 2, ..., until it returns a non-string value. It should return the next possible completion starting with text. The installed completer function is invoked by the entry_func callback passed to rl_comp

readline.set_completer_delims()

readline.set_completer_delims(string) readline.get_completer_delims() Set or get the word delimiters for completion. These determine the start of the word to be considered for completion (the completion scope). These functions access the rl_completer_word_break_characters variable in the underlying library.

readline.remove_history_item()

readline.remove_history_item(pos) Remove history item specified by its position from the history. The position is zero-based. This calls remove_history() in the underlying library.

readline.replace_history_item()

readline.replace_history_item(pos, line) Replace history item specified by its position with line. The position is zero-based. This calls replace_history_entry() 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.