[Tkinter-discuss] Autocomplete example on wiki

python at bdurham.com python at bdurham.com
Thu Jun 23 14:18:28 CEST 2011

I'm looking for a way to add autocomplete functionality to my
Windows based Tkinter applications running under Python 2.7

I've started by using code found on the wiki, but I'm open to
other suggestions as well. Ideally I'd like a solution that works
with the ttk.Entry widget.

Here's the link to the wiki's auto-complete widget that I'm
trying to get to work.

When I run the code on this page, I receive the following

C:\test>py27 tkautocomplete.py
Type a 't' to test the AutocompleteEntry widget.
Will use AutocompleteEntry.set_completion_list((u'test', u'type',
u'true', u'tre
e', u'time'))
Try also the backspace key and the arrow keys.
Traceback (most recent call last):
  File "tkautocomplete.py", line 99, in <module>
  File "tkautocomplete.py", line 89, in test
  File "tkautocomplete.py", line 35, in set_completion_list
    self.bind('<KeyRelease>', self.handle_keyrelease)
AttributeError: AutocompleteEntry instance has no attribute

The traceback complains about a missing handle_keyrelease
attribute which is present in the sample code.

I'm using the 32-bit version of Python 2.7 for Windows under
Windows 7 Professional.

Thank you,


1. http://tkinter.unpythonic.net/wiki/AutocompleteEntry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20110623/b263be53/attachment.html>

More information about the Tkinter-discuss mailing list