PYTHON SHELL AUTOCOMPLETE CONFIG

来源:互联网 发布:mac双系统win8.1激活 编辑:程序博客网 时间:2024/05/22 06:55

create python start up script .pythonrc

import rlcompleter, readline, os atexitreadline.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

原创粉丝点击