配置python命令tab键自动补全

来源:互联网 发布:php上传zip压缩文件 编辑:程序博客网 时间:2024/06/04 23:29
# python startup fileimport sysimport readlineimport rlcompleterimport atexitimport os# tab completionreadline.parse_and_bind('tab: complete')# history filehistfile = os.path.join(os.environ['HOME'], '.pythonhistory')try:readline.read_history_file(histfile)except IOError:passatexit.register(readline.write_history_file, histfile)del os, histfile, readline, rlcompleter

2. add the enviroment varable to system with administrator role

For windowns

pythonstartupf=path/pythonstartup.py

For Linux

add the following to you ~/.bash_profile或bashrc

export PYTHONSTARTUP=~/.pythonstartup




0 0
原创粉丝点击