首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

转:配备python命令tab键自动补全

2012-09-25 
转:配置python命令tab键自动补全1.edit and configure pythonstartup file# python startup fileimport sy

转:配置python命令tab键自动补全
1.edit and configure pythonstartup file

# 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

热点排行