Here is what you’re looking for, create this file:
Then, you need to tell python interpreter to use this ~/.pythonrc file, so add the following line somewhere in an rc file (either ~/.bashrc if you’re using bash or ~/.zshrc for the awesome oh-my-zsh)
You can also run this directly in your shell if you want to test before editing your rc file.
That’s it, fire up a terminal, run python again and enjoy autocompletion when you hit tab key :D
All of the commands you type in a local interpreter are now recorded to ~/.pyhistory. Hit tab when experimenting with modules from the interwebs and it will be much easier to discover all the things :)
For advanced usage, there are a few interpreters available that provide features out of the box such as syntax highlighting while you type: