Search code examples
python-3.xtkintertkinter-entrysearch-box

How to bring data with a search box with typing letters consecutively in Python-Tkinter?


I have created an entry box with tkinter in a page. What I want to do is to convert it into a search box. Whenever I type a letter, I want it to bring me the data that includes these letters from my database. For example when I type "A", I want it bring all names that start with 'A'. And then I typed "L". I want it to bring me all names start with "AL". and so on. Basically each time I add a letter, I want it to update the search and bring me the data according to it. Just like google search box. Can anyone tell me what this event called? Or give a basic code example. Thanks!


Solution

  • Please be a bit more specific with your details so that people can help you better. What is the searchbox retrieving the data from? A database or a list maybe? You could post some code as well which would help everyone understand your predicament better. Hope this article on searchboxes helps you get started. Good luck!

    https://www.tutorialspoint.com/python/tk_entry.htm

    This one below talks about dynamic searchboxes:

    https://www.reddit.com/r/learnpython/comments/22nhwe/dynamic_search_barfilter_with_tkinter/