
1、进入root家目录 建立.tab文件
.tab文件内容如下:
##############################################
import sys
import readline
import rlcompleter
import atexit
import os
readline.parse_and_bind('tab: complete')
histfile = 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
如图:
