30 Apr 2009

Python Tips - python IDLE自动补全

python 2.6.2在windows下好好的自动补全,
到了ubuntu下就没有了作用,但是ipython这个改进的交互式python解释器则可以.
方法如下:

If you want to use auto complete function in ubuntu, you need to install ipython like:



sudo apt-get install ipython


--------------------------------------
ubuntu904+VMware+python2.6,尚未测试成功下面这个方法.
另外一个方法就是麻烦点,每次开python之后输入:

Another method is a little bit complicated:
(This methods hasn't been tested)

>>>import readline, rlcompleter
>>>readline.parse_and_bind("tab: complete")


保存为~/.pythonstartup.py之后,加入~/.bashrc

Then add it to your ~/.bashrc file:

export PYTHONSTARTUP=~/.pythonstartup.py

No comments :

Post a Comment