CentOS下Python自动补全
python 自动补齐只需要两句话
>>> import rlcompleter, readline
>>> readline.parse_and_bind(‘tab: complete‘)
提示:自己安装的python默认是同有安装readline的,所以可以用easy_install 安装它,当然你也可以安装ipython
Windows下Python自动补全
到这里下载 Python Alternative Readline
http://newcenturycomputers.net/projects/download.cgi/Readline-1.7.win32-py2.5.exe
http://newcenturycomputers.net/projects/readline.html
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Alternative ReadLine 1.7 -- Copyright 2001, Chris Gonnerman
>>> import readline
>>> import rlcompleter
>>> readline.parse_and_bind("tab: complete")
这样按Tab键就可以自动补全了。
这下方便多了
在
X:\Python25\Lib\site-packages\readline.py
最后一行增加
import rlcompleter
readline.parse_and_bind("tab: complete")
这样启动命令行启动python.exe时就可以直接用自动补全了
http://newcenturycomputers.net/projects/download.cgi/Readline-1.7.win32-py2.5.exe
http://newcenturycomputers.net/projects/readline.html
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Alternative ReadLine 1.7 -- Copyright 2001, Chris Gonnerman
>>> import readline
>>> import rlcompleter
>>> readline.parse_and_bind("tab: complete")
这样按Tab键就可以自动补全了。
这下方便多了
在
X:\Python25\Lib\site-packages\readline.py
最后一行增加
import rlcompleter
readline.parse_and_bind("tab: complete")
这样启动命令行启动python.exe时就可以直接用自动补全了
本文出自 “linux 生涯” 博客,谢绝转载!