Name

write_history_file

Synopsis

write_history_file(filename='~/.history')

Saves history lines to the text file whose name or path is filename.

An example of a completion function is in module rlcompleter. In an interactive interpreter session (or, more practically, in the startup file that the interpreter runs at the start of each interactive session, as covered in Chapter 3), you can enter:

import readline, rlcompleter
readline.parse_and_bind('tab: complete')

Now, for the rest of this interactive session, you can hit Tab during line editing and get completion for global names and object attributes.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.