Python tab键命令补全

pip install pyreadline

import rlcompleter, readline
readline.parse_and_bind('tab: complete') root@peter-virtual-machine:/usr/lib/python2.7/dist-packages# cat tab.py
import rlcompleter
import readline
import atexit
import os
# http://*.com/questions/7116038/python-tab-completion-mac-osx-10-7-lion
if'libedit'in readline.__doc__:
readline.parse_and_bind('bind ^I rl_complete')
else:
readline.parse_and_bind('tab: complete')
histfile = os.path.join(os.environ['HOME'],'.pyhist')
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del readline, rlcompleter, histfile, os
上一篇:MYSQL 表级锁 行级锁 页面锁区别


下一篇:利用backtrace和objdump进行分析挂掉的程序