python的tab自动补全
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python的tab自动补全相关的知识,希望对你有一定的参考价值。
vi tab.py
#!/usr/bin/env python # python startup file import sys import readline import rlcompleter import atexit import os # tab completion r readline.parse_and_bind(‘tab: complete‘) # history file h histfile = os.path.join(os.environ[‘HOME‘], ‘.pythonhistory‘) try: readline.read_history_file(histfile) except IOError: pass a atexit.register(readline.write_history_file, histfile) del os, histfile, readline, rlcompleter
>>> import sys
>>> sys.path
[‘‘, ‘/usr/local/python2.7/lib/python27.zip‘, ‘/usr/local/python2.7/lib/python2.7‘, ‘/usr/local/python2.7/lib/python2.7/plat-linux2‘, ‘/usr/local/python2.7/lib/python2.7/lib-tk‘, ‘/usr/local/python2.7/lib/python2.7/lib-old‘, ‘/usr/local/python2.7/lib/python2.7/lib-dynload‘, ‘/usr/local/python2.7/lib/python2.7/site-packages‘]
/usr/local/python2.7/lib/python2.7/site-packages 保存到此目录下
以上是关于python的tab自动补全的主要内容,如果未能解决你的问题,请参考以下文章