Enable auto-complete in python interpreter

如何在Python解释器里激活自动补行功能

1. Put following lines into file ~/.pythonrc

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

2. append following line into ~/.bashrc

export PYTHONSTARTUP="${HOME}/.pythonrc"

3. run following command

source ~/.bashrc

4. enter python interpreter

5. test

type

import io

type

io.

then type twich TAB key, you now can see the methods in IO module