Tkinter Autocomplete by using Entry and Listbox options from List using regular expression matching

plus2net
plus2net
5.3 هزار بار بازدید - 3 سال پیش - 00:38
00:38  Different parts of the autocomplete script
01:20 Starting with a blank tkinter window
02:35 Declaring string variable e1_str
02:52 Adding Entry widget
05:04 Adding Listbox widget
09:08 Adding trace method of String variable to trigger get_data() function
10:00 get_data() function
11:49 Regular expression string match
15:10 Adding bind event to Listbox

Part I :     Design , adding options and selection
Tkinter Autocomplete by using Entry a...    
Part II :    Navigation and selection by arrows
Tkinter Autocomplete using down up ar...
Part III : Different data sources, Pygsheets , MySQL database  
Tkinter Autocomplete options using da...
Part IV : Displaying all product attributes on selection
Tkinter autocomplete retrieving other...
Part V: Using colour names as source
Tkinter autocomplete to browse and se...

Source code is here
https://www.plus2net.com/python/tkint...

As the users will enter string in Entry box , we will offer matching options like Autocomplete by using one listbox and user can select any one option to fill the Entry box.
We will place the Listbox below the Entry widget and keep the ypad=0 so both widgets are placed one below the other.
We will change the Listbox background colour and active border colour same as window background colour to merge the layout of the Listbox with the window.
We will trigger and populate the listbox options by taking data from the source listbox , for this we will use one for loop to list all available options and use regular expression match method to get the strings ( options ) matching to the searched string.  
Once the match() method returns true the element is added as option of the Listbox.
We can bind the Listbox selection to pass the selected option as input to Entry widget.
Source code is here
https://www.plus2net.com/python/tkint...

#AutoComplete #EntryAutocomplete #Tkinter #python #SelectOption #StringMatch #plus2net
3 سال پیش در تاریخ 1400/10/12 منتشر شده است.
5,380 بـار بازدید شده
... بیشتر