IDLE and rlcompleter [Was: Re: making the Python case to my dept.]

Jesse Sweeney jesse at student.usyd.edu.au
Sun Nov 7 22:50:33 EST 1999


On 06 Nov 1999 17:50:23 +0000, Michael Hudson <mwh21 at cam.ac.uk> wrote:

[ snip ]

>``import rlcompleter''!!
>
>It makes life *so* much easier, and is the reason I still use the
>basic interpreter rather than idle.
>
>Hmm, implementing completion in idle? It has ``expand word'' but
>that's not what I want. Would this be easy? Pointers appreciated.

Coincidentally, I had the same idea just a few days ago, and after a bit of
tinkering, I came up with two different IDLE extensions. I've put the files on
the web at

http://www-personal.usyd.edu.au/~jsweeney/python .

The first (RLComplete.py) attempts to mimic the behaviour of readline and
rlcompleter in the Python shell, and the second (AutoComplete.py) is a bastard
child of rlcompleter and the current "Expand Word".

Obviously, unlike "Expand Word" these only work in the Python shell, not in the
file-editing windows. (Now that I think about it, this would probably be pretty
useful in those editing windows, but that would take some partial compilation of
some sort I suppose, which is way too much work for me.)

To add these to IDLE, put the two files in your IDLE directory, (or just the one
you want -- I'm flexible!), and add "RLComplete" and "AutoComplete" to the list
of names in extend.py (also in your IDLE directory).

Problems and inconsistencies are documented in the module docstrings. Let me
know of any bugs.

	Cheers, Jesse.




More information about the Python-list mailing list