标签:
1、进入root家目录 建立.tab文件
.tab文件内容如下:
##############################################
import sys
import readline
import rlcompleter
import atexit
import os
readline.parse_and_bind(‘tab: complete‘)
hist
file = os.path.join(os.environ[‘HOME‘], ‘.pythonhistory‘)
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter
##############################################
2、vi /root/.bashrc
export PYTHONSTARTUP=~/.tab
3、重新获取环境变量
. .bashrc
4.测试如下
进入 python 里 首先导入 刚才的模块tab
如图:
Python tab键自动补齐
标签:
原文地址:http://www.cnblogs.com/wspblog/p/4272902.html