Chinaunix首页 | 论坛 | 博客
  • 博客访问: 642022
  • 博文数量: 90
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 2018
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-03 13:09
文章分类

全部博文(90)

文章存档

2010年(7)

2009年(23)

2008年(60)

我的朋友

分类: LINUX

2008-09-04 10:28:16

The default python interpreter doesn't support tab completion,pls use the following method to implement tab completion

1 create a file .pythonrc to your home dir


#!/usr/bin/env python
try:
        import readline
except ImportError:
        print "Module readline not available."
else:
        import rlcompleter
        readline.parse_and_bind("tab: complete")
~


2 add

export PYTHONSTARTUP=~/.pythonrc

to ~/.bashrc

then you can enjoy tab completion in your python interpreter


Python 2.5.2 (r252:60911, Aug 5 2008, 15:28:51)
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = []
>>> x.
x.__add__ x.__iadd__ x.__rmul__
x.__class__ x.__imul__ x.__setattr__
x.__contains__ x.__init__ x.__setitem__
x.__delattr__ x.__iter__ x.__setslice__
x.__delitem__ x.__le__ x.__str__
x.__delslice__ x.__len__ x.append
x.__doc__ x.__lt__ x.count
x.__eq__ x.__mul__ x.extend
x.__ge__ x.__ne__ x.index
x.__getattribute__ x.__new__ x.insert
x.__getitem__ x.__reduce__ x.pop
x.__getslice__ x.__reduce_ex__ x.remove
x.__gt__ x.__repr__ x.reverse
x.__hash__ x.__reversed__ x.sort
>>> x.

阅读(1235) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

pkuwwt2010-01-08 23:17:54

good