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.
|
阅读(1274) | 评论(1) | 转发(0) |