No video

Dependent Drop Downs and List Boxes - Python Tkinter GUI Tutorial

  Рет қаралды 37,853

Codemy.com

Codemy.com

Күн бұрын

In this video I'll show you how to create dependent drop downs, combo boxes, and list boxes for Tkinter.
A Dependent dropdown or listbox is one that changes based on what you clicked in the previous box.
In our example, we'll create a sizes dropdown that has small, medium, and large sizes. When you click on one of them, a second list appears with the colors (red, green, blue, black) that are available for each size.

Пікірлер: 69
@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/39Zwje7
@vincenzo3292
@vincenzo3292 3 жыл бұрын
Thank you for making this video. Been studying tkinter, namely the dep drop-down, but there isn't much out there on that topic. I like how you explain each line of code, what it is for, etc. - that helps to understand the nuances of the framework. I am building a Covid metrics display for work, showing data for each county of every state (number of infected each day, aggregate average, etc.), and this GUI piece is critical for the everyday computer user to make selections. Thanks!
@ahmetbayramtoluc3079
@ahmetbayramtoluc3079 3 жыл бұрын
Hi John. Thanks for great videos. Can you make please make a video which shows how to create a toplevel window inside a main window even if i drag it out.
@yafethtb
@yafethtb 2 жыл бұрын
I just learning about database and I need a way to show item name and the amount of the item. This video help me to do that. So when I choose an item from the first dropdown, the second dropdown will be populated by numbers with the maximum amount is the amount of the item in database. I will try to combine them later so I can make update or insert function to manipulate the database based on the values of both dropdown.
@robh9184
@robh9184 3 жыл бұрын
This function is really useful thanks! As a side note: I have always wondered why we still have to import stuff for Tkinter (eg 'from tkinter import ttk') when we have already imported everything with * (eg 'from tkinter import *')? Seems a bit weird to me. I guess that * refers to all from a basic tkinter package? Anyways.. keep up the good work!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks! Yeah I've always thought it was weird too.
@chococandy8009
@chococandy8009 3 жыл бұрын
Thank you sir, your videos are really helping me in my gui tkinter project. Keep it up and we are waiting for more such fantastic videos :)
@Codemycom
@Codemycom 3 жыл бұрын
Glad you're enjoying them!
@johngiangrande2996
@johngiangrande2996 3 жыл бұрын
Great job, John!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@3zq3mh1
@3zq3mh1 2 жыл бұрын
Man! You make it seems so easy!
@Codemycom
@Codemycom 2 жыл бұрын
Glad you like it!
@vaidehicrs9898
@vaidehicrs9898 2 жыл бұрын
This is great video. I tried this for a similar application in abaqus viewer software. Could you please show how to add a text to the left side of the drop down box? Something like to prompt the user on what is expected to be selected in the dropdown. Also please make a video on how to use the dropdown selection in further code/ application.
@kennethpadgett6243
@kennethpadgett6243 Жыл бұрын
Great video!!! I do have a question...How does one change the location of the drop-down box? I tried using .grid but didn't get the results I wanted.
@Codemycom
@Codemycom Жыл бұрын
You just need to use .grid (or .pack for that matter) correctly.
@aguypassingby1945
@aguypassingby1945 Жыл бұрын
what is "e" that passed to the function? My IDE does not recognize "e")
@user-bn9mt9mu8y
@user-bn9mt9mu8y Жыл бұрын
شرح رائع Thank you
@Codemycom
@Codemycom Жыл бұрын
Welcome!
@kelumdissanayaka9011
@kelumdissanayaka9011 3 жыл бұрын
hey John thank your wonderful lessons......waiting Tkinter login system...video
@Codemycom
@Codemycom 3 жыл бұрын
I already have videos on using databases..which is all you need for a login system.
@sibelylmaz5076
@sibelylmaz5076 2 жыл бұрын
Awesomeee!! How can we pass index number of selection from 1st drop-down list to 2nd drop-down list? Imagine that we have same number of elements in the size and color lists and want to select 2nd drop-down list automatically via index number of 1st selection.
@EngineerToTrader
@EngineerToTrader 3 жыл бұрын
Hi John Thanks lot for great videos
@Codemycom
@Codemycom 3 жыл бұрын
Glad you like them!
@markhillman1450
@markhillman1450 3 жыл бұрын
I am using the same if my_combo.get() = = "Female" and it is not working. (Female is part of my list)
@Codemycom
@Codemycom 3 жыл бұрын
is Female capitalized in your list?
@Eri94
@Eri94 Жыл бұрын
Is it possible to make the list box dependent on what you choose in a combo box?
@kendiener5447
@kendiener5447 3 жыл бұрын
I have e been looking for this and trying everything I could think of for a week. You’re awesome!!!!! CN you bind to a SQLite3 DB as well?
@Codemycom
@Codemycom 3 жыл бұрын
yeah I have a bunch of videos on that
@amitkore9344
@amitkore9344 3 жыл бұрын
This is awesome.. can we bind and make 3 comboboxes and make it dependent.. like state, city and ,zip code.. can you help
@Codemycom
@Codemycom 3 жыл бұрын
Sure you can do that. give this a look: kzbin.info/www/bejne/mHmco2atgp58mtk
@amitkore9344
@amitkore9344 3 жыл бұрын
@@Codemycom i think you gave the same video link..Do you have any video where you described 3 dependent option box
@codingstudio8865
@codingstudio8865 3 жыл бұрын
Sir , please bring C# GUI courses.
@Codemycom
@Codemycom 3 жыл бұрын
I'm not a c# guy
@Codemycom
@Codemycom 3 жыл бұрын
@@JirayuVijjakajohn No...not for like 30 years lol
@ameowingcat1905
@ameowingcat1905 3 жыл бұрын
how do i get a copy of your code for each module so that i can just copy paste and run them for practise so i dont make much errors typing eachline of code. the best tutorials.thanks
@Codemycom
@Codemycom 3 жыл бұрын
The code is always pinned in the comment section...but copying and pasting code is no practice at all lol How does that help you learn?
@bcod53_rushabhbelani50
@bcod53_rushabhbelani50 3 жыл бұрын
sir really searchig for this thanx
@livingstongraphics
@livingstongraphics 3 жыл бұрын
this is greate
@davidvarga5491
@davidvarga5491 2 жыл бұрын
Hi! Could you help me please, how can i use this widget in kivy? Thank you!
@Codemycom
@Codemycom 2 жыл бұрын
You can't use anything from Tkinter in Kivy ever. They're completely different things
@luigi2606
@luigi2606 3 жыл бұрын
thanks for you help
@Codemycom
@Codemycom 3 жыл бұрын
Thanks for watching
@capincrunch1184
@capincrunch1184 3 жыл бұрын
Any way you could show how to get the drop down to take data from excel
@capincrunch1184
@capincrunch1184 3 жыл бұрын
Trying to make it update certain specifications from excel
@albertdupond7399
@albertdupond7399 3 жыл бұрын
Fine
@arjunvc1082
@arjunvc1082 3 жыл бұрын
Sir...how can we get color drop-down values printed ? Please help
@Codemycom
@Codemycom 3 жыл бұрын
Not sure I understand what you're asking
@arjunvc1082
@arjunvc1082 3 жыл бұрын
I'm able to get the value of small - color drop-down values using .get only once when I change the drop-down value to something else it is not returning anything
@DEEPAKTHAKUR-tm7tr
@DEEPAKTHAKUR-tm7tr 3 жыл бұрын
I have some value in a textbox and i want it to get into a Dropdown
@Codemycom
@Codemycom 3 жыл бұрын
Shouldn't be hard
@johnackelley
@johnackelley 3 ай бұрын
Is there a reason not to make it a dictionary? Just asking because I genuinely don't know and for all I know using a dictionary could be less efficient or cause other problems. ``` size_color_dict = { 'small': [ 'red', 'green', 'blue', 'black' ], 'medium': [ 'red', 'green' ], 'large': [ 'blue', 'black' ] } my_combo = ttk.Combobox(root,value=list(size_color_dict.keys())) ```
@Codemycom
@Codemycom 3 ай бұрын
No particular reason so long as it works ;-)
@amitkore9344
@amitkore9344 3 жыл бұрын
When we use .Current(0) function in definition.. it won't allow us to select anything apart from the 1st option form the list.. how we can solve this
@Codemycom
@Codemycom 3 жыл бұрын
No, I don't think that's true. current must be lowercase.
@amitkore9344
@amitkore9344 3 жыл бұрын
@@Codemycom yes.. i tried this.. and it wont allow me to select anything else
@Codemycom
@Codemycom 3 жыл бұрын
@@amitkore9344 Then you did something wrong. You have a typo somewhere or did something different than my video. Are you using different tools like IDLE or something weird like that?
@amitkore9344
@amitkore9344 3 жыл бұрын
@@Codemycom hi.. thanks for your response.. i have created 4 combobox and as state, city, pin and locality.. And have bind then within same.. have set to use current to 3 comboboxes as you defined.. but the values set as (0) dosnt allow to select any other values
@Codemycom
@Codemycom 3 жыл бұрын
@@amitkore9344 Yes, you've explained already that you're having a problem, and I've told you already that you've made a mistake and have a typo somewhere.
@1504shubham
@1504shubham 3 жыл бұрын
where can i get the source code of these examples shown in videos ? do u have any github repo ? it will be really helpful if can get.
@Codemycom
@Codemycom 3 жыл бұрын
Link in the pinned comment of every video.
@peterlyon185
@peterlyon185 3 жыл бұрын
@@Codemycom There is no pinned comment on this video!
@Codemycom
@Codemycom 3 жыл бұрын
@@peterlyon185 Yes there is
@joeyblaq9952
@joeyblaq9952 2 жыл бұрын
🔥🔥🔥
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@charanreddy5227
@charanreddy5227 3 жыл бұрын
Hae john
@Codemycom
@Codemycom 3 жыл бұрын
Hey
@jamikemichelohia2615
@jamikemichelohia2615 3 жыл бұрын
Just in time
Tkinter tutorial for beginners #5: Combobox, Listbox
21:36
Code First with Hala
Рет қаралды 10 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 16 МЛН
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 18 МЛН
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 196 МЛН
English or Spanish 🤣
00:16
GL Show
Рет қаралды 15 МЛН
Basic Search and Autofill - Python Tkinter GUI Tutorial #162
15:13
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 62 М.
Automating My Life with Python: The Ultimate Guide | Code With Me
11:26
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
11:16
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,5 МЛН
Creating a Dropdown Menu in Python Tkinter: A Step-by-Step Guide
8:32
Automate with Rakesh
Рет қаралды 9 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 16 МЛН