Python Code Completion in an Editor

Ionel Simionescu ionel at psy.uva.nl
Sat Dec 4 14:53:21 EST 1999


Olivier Deckmyn <olivier.deckmyn at mail.dotcom.fr> wrote in message
news:82alo7$5ko$1 at feed.teaser.fr...
| "How can I use python code completion in my own application?"
| Is this integration difficult ?

starting point
---

Basically you need to let your editor know that for a certain key (e.g. TAB)
it should:
1. call a function similar to complete(text, state)
(see the rlcompleter module,
http://www.python.org/doc/lib/completer-objects.html)
    and
2. use the result from complete to offer the user a choice or automatically
write some chars.

(Note that you may need to make changes to rlcompleter before you can use
it.)

How you bind the specific keystroke event with this behavior depends on the
API of the text-control you use.


ionel






More information about the Python-list mailing list