March 2003
Intermediate to advanced
656 pages
39h 30m
English
write_history_file
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.
Read now
Unlock full access