It can be helpful to save the contents of a python interpreter interactive session for review; do so by executing the following commands at the end of your interactive session:
import readline readline.write_history_file('/home/barack/history')
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.