Daniel Lemire's blog

, 1 min read

Autocompletion in the Python console

Hans tells us how to have autocompletion in the Python console:

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

This is brilliant, but I wonder how I would ever have guessed this exact sequence of code. Isn’t it a bit obscur?

Anyhow. Hans also tells us how to have this run automatically every time the console is launched. I think it is very nice.