Here's what you do. Store the following file in ~/.pystartup
Don't forget to export PYTHONSTARTUP as noted in the comments.
# Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
# Store the file in ~/.pystartup, and set an environment variable to point
# to it: "export PYTHONSTARTUP=/home/user/.pystartup" in bash.
# Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the
# full path to your home directory.
historyPath = os.path.expanduser("~/.pyhistory")
del os, atexit, readline, rlcompleter, save_history, historyPath
Please note that this will only work on *nix systems. As readline is only available in Unix platform.