15.7.1 Example

The following example demonstrates how to use the
readline module's history reading and writing functions to
automatically load and save a history file named .pyhist from
the user's home directory. The code below would normally be executed
automatically during interactive sessions from the user's
PYTHONSTARTUP file.