阅读背景:

Python2.7设置在shell脚本中自动补全功能的方法

来源:互联网 

1.新建tab.py文件

#!/usr/bin/env python
# python startup file 
import sys
import readline
import rlcompleter
import atexit
import os
# tab completion 
readline.parse_and_bind('tab: complete')
# history file 
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
#!/usr/bin/env python
# pyth



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: