python tab completion Mac OSX 10.7 (Lion)
The above link shows that the following code can be used for autocompletion in python.
import readline
import rlcompleter
if 'libedit' in readline.__doc__:
readline.parse_and_bind("bind ^I rl_complete")
else:
readline.parse_and_bind("tab: complete")
But I don't see where to put it so that it can be loaded at startup. I tried ~/.pythonrc
, but it did not work.
Does anybody know what is the current way to load such a configuration automatically for an interactive python session?