PYTHON SHELL AUTOCOMPLETE CONFIG

create python start up script .pythonrc

import rlcompleter, readline, os atexit
readline.parse_and_bind('tab: complete')
history_file = os.path.expanduser('~/.python_history')
readline.read_history_file(history_file)
atexit.register(readline.write_history_file, history_file)

Note: install the readline package if it is not ready.

Set environment variable PYTHONSTARTUP

export PYTHONSTARTUP=~/.pythonrc

Reload the environment

source ~/.zshrc (~/.bashrc for bash),or you can open a new shell

你可能感兴趣的:(python)