标签:python tab补全
设置python中TAB键自动补全方法
一、创建自动补全脚本如下:
vi /tmp/python/tab.py
#!/usr/bin/python
# python tab 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
二、导入上面创建的模块
#python
>>>import sys
>>>sys.path.append(‘/tmp/python/‘)
>>>import tab
#之后便可利用TAB补全了
本文出自 “银河系|计算机网络” 博客,请务必保留此出处http://qqran.blog.51cto.com/10014850/1957881
标签:python tab补全
原文地址:http://qqran.blog.51cto.com/10014850/1957881