Last Updated: December 26, 2018
·
348
· manas

tab completion in Python interpreter

Enable tab completion in a Python interpreter by adding this to the ~/.pythonrc.py file:

OS X:

import rlcompleter
import readline
readline.parse_and_bind ("bind ^I rl_complete")

Linux:

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

Stackoverflow: http://stackoverflow.com/a/987402