Last Updated: August 12, 2019
·
3.945K
· arifwn

Enable Tab Completion in Python Shell (OSX)

It is annoying that python shell in osx doesn't have autocomplete enabled by default. I used iPython when I need tab completion before I stumbled into this.

Running the following line should enable tab completion on current shell session (make sure to install readline module first). I would be nice to have it in your .pythonrc file as well.

import readline, rlcompleter; readline.parse_and_bind("tab: complete")

source: https://news.ycombinator.com/item?id=5658062