Basic Search and Autofill - Python Tkinter GUI Tutorial

  Рет қаралды 51,271

Codemy.com

Codemy.com

3 жыл бұрын

In this video we'll create a simple search and autofill function with Tkinter and Python.
We'll create an entry box and a list box full of pizza toppings. As you start to type a topping into the entry box, the listbox will automatically update to show toppings that look like what you're typing.
This is a very basic search function and the beginnings of an auto complete or autofill function that you can play with.
** NOTE - TYPO IN THE CODE
my_entry.insert(0, my_list.get(ACTIVE))
should be
my_entry.insert(0, my_list.get(ANCHOR))

Пікірлер: 195
@Codemycom
@Codemycom 3 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/3oO2QZ9
@sanaullakhan7630
@sanaullakhan7630 3 жыл бұрын
while I search all data from listbox gets vanished and while I erase it gets back, please help, I have used my database values which include all integers into a list. all other operation are working fine but search*
@wellsleland4933
@wellsleland4933 2 жыл бұрын
Instablaster...
@snex-techprogrammer5110
@snex-techprogrammer5110 2 жыл бұрын
Is this possible when you have items in the database and you want to search with auto fill?
@Codemycom
@Codemycom 2 жыл бұрын
@@snex-techprogrammer5110 Probably, you might have to tinker with it a bit
@hisanimations2495
@hisanimations2495 3 жыл бұрын
I found this guy 3 days ago, AND HE'S SUCH A GOOD TEACHEEEEEERRRR!!!!!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
he is!
@sammflynn6751
@sammflynn6751 Жыл бұрын
My man , I just want to give you a bug hug for making these amazing tutorials for free, I will buy everything as soon as I have money
@Codemycom
@Codemycom Жыл бұрын
Thanks!
@michakilanowski9188
@michakilanowski9188 3 жыл бұрын
I have learned so much from your videos! You are always putting so much efford to make these tutorials! Keep it up
@Codemycom
@Codemycom 3 жыл бұрын
Happy to hear that!
@ricardogalvao386
@ricardogalvao386 4 ай бұрын
Mais uma vez, Parabéns. Sempre que preciso de ajuda, suas aulas sempre me mostra um caminho. top.
@judeleon8485
@judeleon8485 3 жыл бұрын
Thanks John, you never disappoint.
@Codemycom
@Codemycom 3 жыл бұрын
Welcome :-)
@jackryan3789
@jackryan3789 3 жыл бұрын
Thank you so much for making these videos, they're extremely helpful to me.
@Codemycom
@Codemycom 3 жыл бұрын
Glad you like them!
@RyanDanielG
@RyanDanielG 2 жыл бұрын
Hit that like button Python Fans! Great tutorial. Feed the Algorithm!
@bantuthomas
@bantuthomas 3 жыл бұрын
Very useful snippet. Thanks!
@Codemycom
@Codemycom 3 жыл бұрын
Welcome
@siddheshshanker4162
@siddheshshanker4162 2 жыл бұрын
Awesome tutorial, got my work done.
@Codemycom
@Codemycom 2 жыл бұрын
Great!
@hajimenagao8806
@hajimenagao8806 2 жыл бұрын
Great explanation, I am going to add this feature to my text editor. Thank you!
@Codemycom
@Codemycom 2 жыл бұрын
Nice!
@borispasynkov1404
@borispasynkov1404 3 жыл бұрын
If you want your listbox to update only by the letters from the beginnig of the word, change your code in that fucntion this way: typed= my_entry.get() length_of_typed=len(typed) if typed == '': data = toppings else: data=[] for item in toppings: if typed.lower() in item.lower()[0:length_of_typed]: data.append(item) update(data)
@Felix-jn2ly
@Felix-jn2ly 2 жыл бұрын
It got an error on if typed == '': IndentationError: unindent does not match any outer indentation level Edit: after typing to fix it, i use codemy.com code then manually add the different ones only from your suggestion, it's working. Kinda weird why i can't copy paste your code, it's giving me the error message. But it's already working. Thanks
@brockmcpherson4952
@brockmcpherson4952 Жыл бұрын
what if you want the listbox to update based on any similar/matching characters from any words. For example, if someone types "Abailable" instead of "Available" is there a way to add code that will still return the corrected "Available" in the list box?
@superporff7455
@superporff7455 3 жыл бұрын
Great tutorial. You explain really well 👏
@Codemycom
@Codemycom 3 жыл бұрын
Glad you liked it!
@drawartwithfun5162
@drawartwithfun5162 3 жыл бұрын
your videos help me a lot as a solution to my problems
@Codemycom
@Codemycom 3 жыл бұрын
Glad to hear it!
@danielalegriasallo5551
@danielalegriasallo5551 3 жыл бұрын
thanks, just what i needed.
@Codemycom
@Codemycom 3 жыл бұрын
Glad you found it!
@haouariabderrahime6287
@haouariabderrahime6287 Жыл бұрын
So simple, so powerful...
@Codemycom
@Codemycom Жыл бұрын
glad you enjoyed it!
@DarkSpeedKiller
@DarkSpeedKiller 3 жыл бұрын
another great video and very helpfull!
@Codemycom
@Codemycom 3 жыл бұрын
Glad it was helpful!
@ADJOUFFOUPRODofficie
@ADJOUFFOUPRODofficie 3 жыл бұрын
Thank you so much!!!!
@Codemycom
@Codemycom 3 жыл бұрын
You're welcome!
@valentinvalenciavalencia7299
@valentinvalenciavalencia7299 Жыл бұрын
Thank you very much sir.
@Codemycom
@Codemycom Жыл бұрын
Welcome!
@DauphinetB
@DauphinetB 3 жыл бұрын
Hey, great videos! I'm learning a lot! But please, put the typo error higher up in the description. I spent shitloads of time trying to debug it on my app until I went back to this video, RIP.
@paraskunwar5081
@paraskunwar5081 3 жыл бұрын
Amazing Video!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@laurentreynaud4404
@laurentreynaud4404 3 жыл бұрын
thank you so much !!!
@Codemycom
@Codemycom 3 жыл бұрын
Sure thing!
@aaryansachdeva
@aaryansachdeva 3 жыл бұрын
tkinter can do so much!
@Codemycom
@Codemycom 3 жыл бұрын
It really can :-)
@david0411
@david0411 Жыл бұрын
If anyone wants the searching to be exact e.g. if you don't want 'Ham' pops up when type M, do this in the for loop: if item.lower().startswith(typed.lower()): data.append(item)
@shaphaymusic8869
@shaphaymusic8869 2 жыл бұрын
super helpful tutorial thank you
@Codemycom
@Codemycom 2 жыл бұрын
Glad it was helpful!
@hossienhassanhamow3489
@hossienhassanhamow3489 3 жыл бұрын
Thank you My son and I like you so much , you're the best
@Codemycom
@Codemycom 3 жыл бұрын
Thanks! I appreciate that!
@idk____idk6530
@idk____idk6530 3 жыл бұрын
🤟 intro is always op 🔥
@Codemycom
@Codemycom 3 жыл бұрын
Ha thanks
@codeKeshav
@codeKeshav 3 жыл бұрын
Very energetic intro
@ashokkumarmuthyam2986
@ashokkumarmuthyam2986 3 жыл бұрын
Thank you sir
@Codemycom
@Codemycom 3 жыл бұрын
Very Welcome!
@axel9546
@axel9546 2 жыл бұрын
I just wanted to create a "CTRL+F" or "INPUT TEXTBOX" to be able to search text inside the tkinter GUI. Like when you are on a browser and hit "CTRL+F" to quickly find the text you need, I would need to do the same, but on the GUI. How would be possible to do that?
@Codemycom
@Codemycom 2 жыл бұрын
You need to use bindings...I have videos on them
@iagobeulleryeah
@iagobeulleryeah 3 жыл бұрын
There is a way to do entry with transparent bg over image on a canvas, for later save a png?
@maxwellhawk
@maxwellhawk Жыл бұрын
For example I have Table with Headers. And I want make headers work as menubuttons but with ability to search like in this video. So once I enter 'C' all data under that header is removed and appear the one only that starts on 'C'. What the best practice to accomplish it? I would like to add something like that on each header so I could do filter by any Column. At the same time list of data might be exceed window, so I need scrollbar there.
@crypto1886
@crypto1886 3 жыл бұрын
i am binge watching, i started this yesterday lol
@Codemycom
@Codemycom 3 жыл бұрын
Awesome
@condygo1311
@condygo1311 Жыл бұрын
thanks for your teaching, help me to solve the problem.
@Codemycom
@Codemycom Жыл бұрын
happy to hear it!
@brockmcpherson4952
@brockmcpherson4952 Жыл бұрын
Hi John, thank you for the video. New to coding, wondering if you have any tips for building more advanced search functionality into this example to make it more comprehensive/user friendly. Thanks!
@Codemycom
@Codemycom Жыл бұрын
Sorry, I don't have any videos on that
@sachinyadav-us4fe
@sachinyadav-us4fe 3 жыл бұрын
very good videos you made sir add more so i want become master in tkinter python
@Codemycom
@Codemycom 3 жыл бұрын
There's already 162 videos in this playlist, did you watch them all? :-p
@sachinyadav-us4fe
@sachinyadav-us4fe 3 жыл бұрын
@@Codemycom not all but videos sir But I watched 30 -40 videos for project file. Thank you
@sharkgamer1687
@sharkgamer1687 3 жыл бұрын
Me before finding this guy: Tkinter awfully sucks Me after finding this guy: Woah tkinter is actually a good GUI library
@Codemycom
@Codemycom 3 жыл бұрын
Ha thanks!
@frikuus
@frikuus Жыл бұрын
Great work! How to convert list to table and search a specific column?
@jackzero5230
@jackzero5230 3 жыл бұрын
Hi John, Is it possible to do the same search and autofill with combobx? else what is the option to get a dynamic dropdown list based on the letters we type in?
@Codemycom
@Codemycom 3 жыл бұрын
I've never tried it before but I suppose so
@quteibaalsalaa6346
@quteibaalsalaa6346 3 жыл бұрын
can i do the same search with treeview connected to DB?
@teevee00
@teevee00 3 жыл бұрын
What python are you using to have the black background? The autocomplete I’m looking for is when your typing a command and a list pops up just below to finish your commands? Sorry for the noob question
@Codemycom
@Codemycom 3 жыл бұрын
any version...it's not python that does that. It's the Sublime Text Editor.
@teevee00
@teevee00 3 жыл бұрын
@@Codemycom thank you so much!!
@Codemycom
@Codemycom 3 жыл бұрын
@@teevee00 sure thing!
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
i want to check only the ones that start with my entry(typed) what shall i do?
@rossvrg2446
@rossvrg2446 2 жыл бұрын
I hope someone can help me, I want to make this autofill for multiple data. I mean for example, if into de entry I put some contry (the contry have an abreviation), with bind for every contry that I put in that entry can put the abreviation of this contry insted the complete name. The problem is it work for one contry but when I put a coma and the start to write for a new contry the autofill funtion stop working. How I can fix that? or where do I can find some help?
@meesiphht2769
@meesiphht2769 3 жыл бұрын
If you want to select the item in the list that pops up as you type with the keyboard do you have to write a function for that as well? or is that another keyword in PyQt or Python?
@Codemycom
@Codemycom 3 жыл бұрын
Huh? This is tkinter, not PyQT
@meesiphht2769
@meesiphht2769 3 жыл бұрын
@@Codemycom Oh yeah, that's what I get for just letting these videos roll but I meant if you want to select with the keyboard instead of the mouse how would you code that?
@Codemycom
@Codemycom 3 жыл бұрын
@@meesiphht2769 To do stuff with the keyboard you need to use bindings. I have videos on that in the playlist
@meesiphht2769
@meesiphht2769 3 жыл бұрын
@@Codemycom okay, thanks
@joeyblaq9952
@joeyblaq9952 2 жыл бұрын
🔥👍
@Codemycom
@Codemycom 2 жыл бұрын
:-)
@UshaDarja
@UshaDarja 2 жыл бұрын
I am getting "TclError: no event type or button # or keysym" error while running code
@learnnow9598
@learnnow9598 3 жыл бұрын
Good one 😍. Can you make this for kivy too?
@Codemycom
@Codemycom 3 жыл бұрын
Sure
@miraceti56
@miraceti56 3 жыл бұрын
Hi, there is a little "bug". when the window is opening and i click on the second element of the list in the listbox (Peppers) it is "Pepperoni" that appears in the entry box!!
@Codemycom
@Codemycom 3 жыл бұрын
My bad, typo in the code. Your ACTIVE should be ANCHOR
@doc9897
@doc9897 3 жыл бұрын
Thanks so much will you do live search for treeview columns to also
@Codemycom
@Codemycom 3 жыл бұрын
Already did search with tree view
@forrestchiang2361
@forrestchiang2361 3 жыл бұрын
Thanks for your video. But is it possible to make 2 entry boxes that share and search through the same list box individually.
@Codemycom
@Codemycom 3 жыл бұрын
sure, what's the issue?
@forrestchiang2361
@forrestchiang2361 3 жыл бұрын
Thanks for your reply. My problem is that when I type in the second entry box and click on the listbox, it refreshes the first entry box rather than the second one. (Sorry for inaccurate English)
@moeezsaleem7072
@moeezsaleem7072 3 жыл бұрын
hey john, how do we access the chosen variable. Say I clicked on Mushrooms and now i want to enter that somewhere else as a variable. I'm thinking .get() attached to something but can't figure it out.
@Codemycom
@Codemycom 3 жыл бұрын
I have tons of videos on .get() from an entry box
@jakeevans6935
@jakeevans6935 3 жыл бұрын
Great video. Have you done a tutorial about sending notifications with tkinter is that possible?
@Codemycom
@Codemycom 3 жыл бұрын
No I haven't.
@hiwab41
@hiwab41 3 жыл бұрын
I was looking for this thank you so much 😊 , but could you do this with database?
@Codemycom
@Codemycom 3 жыл бұрын
Sure you could, though it's easy to search a database in the normal way.
@hiwab41
@hiwab41 3 жыл бұрын
@@Codemycom While i run the code i get an error here is the code: from tkinter import * import sqlite3 root = Tk() root.title('Auto Search') root.geometry("500x300") # Update the listbox def update(data): # Clear the listbox my_list.delete(0, END) # Add toppings to listbox for item in data: my_list.insert(END, item) # Update entry box with listbox clicked def fillout(e): # Delete whatever is in the entry box my_entry.delete(0, END) # Add clicked list item to entry box my_entry.insert(0, my_list.get(ANCHOR)) # Create function to check entry vs listbox def check(e): # grab what was typed typed = my_entry.get() if typed == '': data = toppings else: data = [] for item in str(toppings): if typed(str) in item(str): data.append(str(item)) # update our listbox with selected items update(data) # Create a label my_label = Label(root, text="Start Typing...", font=("Helvetica", 14), fg="grey") my_label.pack(pady=20) # Create an entry box my_entry = Entry(root, font=("Helvetica", 20)) my_entry.pack() # Create a listbox my_list = Listbox(root, width=50) my_list.pack(pady=40) # connect the database conn = sqlite3.connect('hsinfo.db') c = conn.execute('select * from TarifInfo') # Create a list of pizza toppings toppings = [c] conn.commit() c.close() # Add the toppings to our list update(toppings) # Create a binding on the listbox onclick my_list.bind("", fillout) # Create a binding on the entry box my_entry.bind("", check) root.mainloop()
@Codemycom
@Codemycom 3 жыл бұрын
@@hiwab41 what's the error?
@hiwab41
@hiwab41 3 жыл бұрын
@@Codemycom I inserted (by Select query ) data from database to Listbox but search doesn’t work only When I click on an item on listbox (toppings) it update or show on Entry. So now I need your help to solve search problem :)
@hiwab41
@hiwab41 3 жыл бұрын
My dad will enroll me with total membership of your courses. So I’m so happy
@devenjain7116
@devenjain7116 3 жыл бұрын
Please make a video on performing search operations on treeview
@Codemycom
@Codemycom 3 жыл бұрын
Might do that
@devenjain7116
@devenjain7116 3 жыл бұрын
@@Codemycom Yess please! I am trying that, I initialize a StringVar() and add .trace("w",nameoffunction) to it so it runs the function everytime I type a letter into the entry box whose textvariable=(the StringVar() I initialized) and then It runs the function and deletes the record for which we searched and .inserts it at the top of the treeview... In short, *it does not work!!!*
@Greentard457
@Greentard457 3 жыл бұрын
is this possible for a program with multiple entry boxes? I tried but selecting one will fill all the entry boxes
@Codemycom
@Codemycom 3 жыл бұрын
It should be. Did you name all your entry boxes the same thing or something?
@snex-techprogrammer5110
@snex-techprogrammer5110 2 жыл бұрын
Is this possible when you have items in the database and you want to search with auto fill?
@Codemycom
@Codemycom 2 жыл бұрын
Probably, you might have to tinker with it a bit
@programmertank3029
@programmertank3029 2 жыл бұрын
Maybe change toppings (the searching list) to .txt file?
@pickelbyte
@pickelbyte Жыл бұрын
hippity hoppity this code is now my property
@Codemycom
@Codemycom Жыл бұрын
lol
@ali-mw8nf
@ali-mw8nf 2 жыл бұрын
You are nice teacher... Sir please tell me how can we get data in the list from sqlite3 data base
@Codemycom
@Codemycom 2 жыл бұрын
I have lots of videos on tkinter and sqlite3 on this playlist. Check it out.
@learnwithnawf246
@learnwithnawf246 3 жыл бұрын
Sir how to make it look like drop-down like we see while searching in Google
@spearsharp8682
@spearsharp8682 3 жыл бұрын
Now i want Tacos-topping pizza
@Codemycom
@Codemycom 3 жыл бұрын
Right?!
@waserased5176
@waserased5176 2 жыл бұрын
Hi! Sorry for the late comment but i'm having trouble running the code in Python. It always comes up with _tkinter.TlcError: no event type of button # or keysym
@Codemycom
@Codemycom 2 жыл бұрын
What did you do differently from the video?
@waserased5176
@waserased5176 2 жыл бұрын
@@Codemycom I didn’t actually put in any parameters sorry! My bad lol, great video :)
@Codemycom
@Codemycom 2 жыл бұрын
@@waserased5176 glad you got it sorted out
@komodojackgaming7802
@komodojackgaming7802 3 жыл бұрын
Yah boy im the second dude to comment
@Codemycom
@Codemycom 3 жыл бұрын
Sweet
@prakashv1350
@prakashv1350 3 жыл бұрын
Is there possible to create autocomplete entry that fetch database values. Could you please help me?
@Codemycom
@Codemycom 3 жыл бұрын
Sure, I have videos on this playlist that show how to pull stuff from a database. It would be trivial to add the autocomplete thing to it.
@prakashv1350
@prakashv1350 3 жыл бұрын
@@Codemycom first up all thanks for your reply. yep I will watching your python related videos and your are doing just amazing things with python
@Codemycom
@Codemycom 3 жыл бұрын
@@prakashv1350 Glad you're enjoying the videos :-)
@prakashv1350
@prakashv1350 3 жыл бұрын
@@Codemycom thank you 😊
@sharan9993
@sharan9993 2 жыл бұрын
can i add an enter button so that input is taken into the code to be used and user can input the next one
@Codemycom
@Codemycom 2 жыл бұрын
Sure, it's coding..you can do anything you want.
@sharan9993
@sharan9993 2 жыл бұрын
@@Codemycom yea i got that working also needed to collect a bunch of similar inputs from user so used a loop along with destory once the input is received. How to make the user input be returned somewhere else instead of the just function we input as command?
@Codemycom
@Codemycom 2 жыл бұрын
@@sharan9993 Once you pull it into a function, you can do anything you want with it. Save it however you want.
@sakethdamam3280
@sakethdamam3280 2 жыл бұрын
can we do this using combobox drop down list
@Codemycom
@Codemycom 2 жыл бұрын
Give it a try and see :-p
@nonamegode2321
@nonamegode2321 3 жыл бұрын
Hi, Codemy do you now how to fix the git bash permissin denied error, if you now can you make a video about it.
@Codemycom
@Codemycom 3 жыл бұрын
what error, there are thousands of permission denied types of errors. You likely didn't install python correctly. Reinstall it, and be sure to check the "Add Python 3.x to Path" checkbox on the installation screen.
@pikleman5880
@pikleman5880 3 ай бұрын
How do I make it so that the first entry is not automatically selected when I click on the Listbox?
@idk____idk6530
@idk____idk6530 2 жыл бұрын
Sir can we make same in kivy I'm working on my personal project I need same functionality in my kivy app , Is it possible ...?
@idk____idk6530
@idk____idk6530 2 жыл бұрын
@@Codemycom can you make a video on This Topic ???...
@__leelight
@__leelight 2 жыл бұрын
brother i have a small problem i hope that you can help . everything is working fine but its showing me all the list its only showing one item when i use the update function . can you plz help
@Codemycom
@Codemycom 2 жыл бұрын
Check your code for errors
@aadithyanarayanan1178
@aadithyanarayanan1178 3 жыл бұрын
yo! could you please show how to sort records in tkinter with sql? bug thanks man
@Codemycom
@Codemycom 3 жыл бұрын
I have some videos on this playlist with sqlite and tkinter
@dunghoang5728
@dunghoang5728 8 ай бұрын
Hi, please help me How to hide list text and only display when seaching?
@codeKeshav
@codeKeshav 3 жыл бұрын
Could we resize a Textbox
@Codemycom
@Codemycom 3 жыл бұрын
sure... I have videos on textboxes that show that
@sithuhtun3609
@sithuhtun3609 3 жыл бұрын
Can you show us how to run kivy file on android please?
@Codemycom
@Codemycom 3 жыл бұрын
this is a tkinter video, not kivy
@sithuhtun3609
@sithuhtun3609 3 жыл бұрын
@@Codemycom Can you make kivy video that show how to run on android plesae?
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
sorry ! but it don't work for me :( because my list box is changeable i mean like in my programe you are able to add sth or delete sth from list box so when i erase all and back to typed == ' ' all of the items erase: '( how can i fix it
@programmertank3029
@programmertank3029 2 жыл бұрын
Please show me your code first
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
@@programmertank3029 actually i fixed it : ) thank you at all
@programmertank3029
@programmertank3029 2 жыл бұрын
@@amirmohammadk745 Good to hear it!
@122nameeasport7
@122nameeasport7 3 жыл бұрын
Can you do this for kivy
@Codemycom
@Codemycom 3 жыл бұрын
Sure
@inventoryapp1688
@inventoryapp1688 2 жыл бұрын
How to remove this listbox after selecting an item?
@Codemycom
@Codemycom 2 жыл бұрын
In the same way you remove anything in tkinter.
@wendeng6279
@wendeng6279 2 жыл бұрын
where to download the sourcecode? thanks.
@Codemycom
@Codemycom 2 жыл бұрын
Exactly where I said in the video...in the pinned comment.
@nohaezz818
@nohaezz818 3 жыл бұрын
I took the code copy paste and check function not working well
@Codemycom
@Codemycom 3 жыл бұрын
Yeah copy paste sucks. Write it yourself.
@gangjiatharva999
@gangjiatharva999 3 жыл бұрын
How do I put this on my django website?
@Codemycom
@Codemycom 3 жыл бұрын
You don't. Tkinter makes desktop apps, not web apps
@gangjiatharva999
@gangjiatharva999 3 жыл бұрын
@@Codemycom no, no, I made a django website, can I put this on that website?
@Codemycom
@Codemycom 3 жыл бұрын
@@gangjiatharva999 no, tkinter apps don't work on websites.
@gangjiatharva999
@gangjiatharva999 3 жыл бұрын
@@Codemycom oh, then how do I put GUI's like this on my django website?
@Codemycom
@Codemycom 3 жыл бұрын
@@gangjiatharva999 you don't put them on any website, they aren't web apps. These are desktop software things.
@nickgasparis1709
@nickgasparis1709 Жыл бұрын
can you please do the same example with classes ? PLEASE PLEASE PRETY PLEASE
@Codemycom
@Codemycom Жыл бұрын
No, sorry...there's nothing to it if you know classes already. If you don't, then why are you using classes?
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
no dislike
@aritramarik4487
@aritramarik4487 2 жыл бұрын
self.entName = Entry(LeftFrame1, font =('arial', 13, 'bold'), bd=6,width=50, justify='left', textvariable=Name) self.entName.grid(row=2, column=1, sticky=W, padx=2) self.my_list = Listbox(LeftFrame1, font =('arial', 13, 'bold'),height = 3, width=51, justify='left') self.my_list.grid(row=3, column=1, sticky=W, padx=2) listVal = ['Arnab', 'Anik', 'Aritra'] # Create a binding on the listbox onclick self.my_list.bind("", fillout) # Create a binding on the entry box self.entName.bind('', check) this is my code snippet but I keep getting the error : _tkinter.TclError: no event type or button # or keysym I tried using "" and '' respectively but they don't work either. In that case the check function doesn't work. Can someone help?
@ishahzaibkhan
@ishahzaibkhan 2 жыл бұрын
425 like and 0 dislikes
@Codemycom
@Codemycom 2 жыл бұрын
awesome
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
yourrr dreaamm
@Codemycom
@Codemycom 2 жыл бұрын
thanks
@miraceti56
@miraceti56 3 жыл бұрын
ok ANCHOR and not ACTIVE is better
@Codemycom
@Codemycom 3 жыл бұрын
yep
@hello-my6ot
@hello-my6ot 3 жыл бұрын
Im using tkinter 2 years not knowing theres a listbox lol
@Codemycom
@Codemycom 3 жыл бұрын
ha
@arturgerlei691
@arturgerlei691 10 ай бұрын
def fillout(e): selected=my_listbox.curselection() my_entry.delete(0, END) # add clicked list item to entry box my_entry.insert(0,my_listbox.get(selected))
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 33 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 36 МЛН
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,5 МЛН
creating tables in tkinter with the treeview widget
14:44
Make Tkinter Look 10x Better in 5 Minutes (CustomTkinter)
4:40
TurbineThree
Рет қаралды 245 М.
Using Databases With TKinter - Python Tkinter GUI Tutorial #19
9:40
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 273 М.
The grid layout method in tkinter
22:44
Atlas
Рет қаралды 25 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 248 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 33 МЛН