Using tkinter with classes

  Рет қаралды 74,681

Atlas

Atlas

Күн бұрын

Пікірлер
@jayramsey853
@jayramsey853 10 ай бұрын
I don't understand how you only have 5.88k subscribers! This is so well explained, which for these tutorials is rare, thank you so much!
@jayramsey853
@jayramsey853 10 ай бұрын
Edit: Didnt realise u had a much bigger channel, but i still stand by what i said
@electronyxinc2729
@electronyxinc2729 6 ай бұрын
just found him today I like it
@writart3723
@writart3723 Ай бұрын
Can't agree more.
@rishabhagnihotri6004
@rishabhagnihotri6004 9 ай бұрын
The best video for tkinter till date🙏
@mikeniemotka9547
@mikeniemotka9547 9 ай бұрын
This was an awesome explanation as you did a side by side with the NON class code. Really appreciate it
@TV-eh9fi
@TV-eh9fi Жыл бұрын
This tutorial is way better than the others. You are giving comparisons (unlike other tutorials) which is what we need. Thank you.
@jimalix6270
@jimalix6270 2 ай бұрын
Your videos are awesome! You have a great teaching style - you explain thoroughly, and you speak slowly enough so we can process what you're saying as you're writing the code. Thanks!
@darrenlefcoe
@darrenlefcoe 2 ай бұрын
Another excellent video. The only thing to mention here is that the gain is only seen for much larger projects. The new code in this case is actually 25% longer than the old code.
@FernandoSantos-on5ry
@FernandoSantos-on5ry Жыл бұрын
Standing ovation, Sir!👏 I have watched all these (your) videos from the first one and will continue to the last one (#40) because they are so good! My deepest congratulations, inspiring!
@timlambert3673
@timlambert3673 Жыл бұрын
Have to agree - the best instructor I’ve found thus far. Deserves more attention
@rickyusuf8696
@rickyusuf8696 10 ай бұрын
Bro, this is amazing! One of the best well-explained videos on class-based apps. I am using this approach, but do have doubts sometimes on how to organize the code properly. Thank you for making this easier!
@deeplazydev
@deeplazydev Жыл бұрын
Amazing, finally someone creating a good structure and a pedagogic way. Congrats!
@doktor.paichiwo
@doktor.paichiwo Жыл бұрын
Amazing. Finally got to understand how classes work. Your tutorials are the best, thank you for doing them. ❤
@larsondavis8155
@larsondavis8155 5 ай бұрын
These are fantastic. Dude, youre an excellent teacher, pointing out the right things and making it so understandable. Much appreciated
@TechWazza
@TechWazza 6 ай бұрын
I've watched this video at least twice and reproduced the content. It's an outstanding example of using OOP and tk. Thanks!
@mayankb
@mayankb 6 ай бұрын
These are indeed worth in gold.. KZbin algorithm sucks..
@simonkroschel3662
@simonkroschel3662 8 ай бұрын
This ist the BEST explanation i found on KZbin.
@rakesh.a.c
@rakesh.a.c Жыл бұрын
the best video on this topic. you deserve way more subscribers
@natiadonay2104
@natiadonay2104 Жыл бұрын
yep
@natiadonay2104
@natiadonay2104 Жыл бұрын
are you beginner programmer like me?
@rakesh.a.c
@rakesh.a.c Жыл бұрын
@@natiadonay2104 new to tkinter :)
@drvermillion_sama
@drvermillion_sama Жыл бұрын
wooow I can't speak, before this video I had a lot of problems understanding the classes, and I had no idea how and why should I use them but know you opened my mind and make me see their importance and make me understand them easily.... thank you very much from all my heart ❤ .
@strangerist2
@strangerist2 8 ай бұрын
Thank you, this is superb. Very clearly explained, and exactly what i was looking for. The only difficulty I had was that many of my labels have text that changes as part of the program, so I had to call mainloop using the object (instance), rather than from within the class constructor. I can't see any way around that, but if anyone reading this has any thoughts I'd love to hear them. Thanks again for such a clear and detailed explanation.
@chanero-u8z
@chanero-u8z 6 ай бұрын
I get new understanding of tkinter, thanks you❤
@sustrasbk
@sustrasbk 4 ай бұрын
Some super helpful videos, excellent quality! Any chance you could make a video talking about passing information between the frames? Eg, when a button inside Main frame is pressed, it should update something inside the Entry frame? In my particualr case - I have a class which contains a matplotlib canvas and I have a few classes defining different frames which contains some buttons and entries. I want the matplotlib canvas to be updated based on the entries and button pressed in those different frames
@Ingo-ns3qp
@Ingo-ns3qp Жыл бұрын
Great Videos! I learnt a lot. Thank you
@natiadonay2104
@natiadonay2104 Жыл бұрын
are you beginner programmer like me?
@jacobjacob3
@jacobjacob3 Жыл бұрын
Thank you for the video! It was super helpful.
@odams
@odams 2 жыл бұрын
Love you, literal live-saver
@natiadonay2104
@natiadonay2104 Жыл бұрын
are you beginner programmer like me?
@odams
@odams Жыл бұрын
@@natiadonay2104 kinda yeah
@SkyOcean-lg7lt
@SkyOcean-lg7lt 10 ай бұрын
Biggest help ever!
@jbt8903
@jbt8903 7 ай бұрын
Very clear and easy to understand videos, easiest I have found to follow and comprehend. Would you continue with the series by adding commands to the buttons and then splitting the parts into separate modules or .py files. I am trying to create a sqlite database app with a lot of tables and table editing windows but am struggling as it gets too complex and I have been unable to split the modules while maintaining functionality. It a model train/Item inventory database Thank you for your videos!
@rylanb.409
@rylanb.409 7 ай бұрын
Yes. I was wondering if he would create a video with the OOP approach but with functioning buttons next time. Here it is mainly just creating and placing widgets
@flopism493
@flopism493 3 ай бұрын
great implementation
@MariniSukamto
@MariniSukamto Жыл бұрын
Thank you. This is so helpful
@kendiener5447
@kendiener5447 Жыл бұрын
thank you!!! Explained very well.
@joejoeman3645
@joejoeman3645 Жыл бұрын
Thanks my man I love it and I love you!! Xoxo
@mlfelonzo9156
@mlfelonzo9156 11 ай бұрын
Sir i have a question on the main frame i don't under why you make 2 frames in side the other frame.?
@hoerbschmidt618
@hoerbschmidt618 Жыл бұрын
Great explanations!
@whyyouhavetobemad8569
@whyyouhavetobemad8569 Жыл бұрын
Hi, great video. Only thing I don't understand is why there was another class made for the last frame? Why not make another frame in the main class
@dundy96
@dundy96 Жыл бұрын
Not sure if you care anymore haha but my guess was that rather than creating and packing each button and label you're able to do that once, and then create 2 (or more) instances of it. Like let's say instead of 2 label/button pairs he wanted 10. If he didn't create the class, he would have to write all the ttk.Label and ttk.Button and the packing code out 10 different times. Whereas with the class, he adds the Label/Button and .pack() code only once, and then just creates 10 instances of it.
@2002budokan
@2002budokan 11 ай бұрын
Why do you prefer class inheritence instead of composition, is there any reason that I don't know yet? I ask this question, because all component based web applications construct their components via composition further I know how difficult to maintain inheritence based approach from ancient MFC applications. But all OO tkinter courses prefer class inheritence, maybe there is a good reason? Consider how difficult to switch from Tkinter to CustomTkinter if you prefer class inheritence.
@maleldil1
@maleldil1 2 ай бұрын
People prefer inheritance because that's what they have been told in classes that focus too much on OO rather than general design principles. There's no real reason to use OO with tkinter other than slight convenience at the cost of overcomplicating your code structure. They're using implementation inheritance, which is a no-no in 99% of the cases where composition would accomplish the same while being much simpler.
@henryqiu227
@henryqiu227 Жыл бұрын
to solve the local variable problem, you can pass them as the parameters
@notanumber-fy8mp
@notanumber-fy8mp Жыл бұрын
It works perfectly on Windows 7 but the red label will not display on Linux Mint 20.3 My mistake! In the class Menu(ttk.Frame): Def __init__(self, parent): I entered __init__ as __int__ This occurred using one of the built-in features of PyCharm. An easy mistake to make, but not easy to spot (with my eyesight). Many thanks for the videos!
@DifferentThinker
@DifferentThinker Жыл бұрын
can i know, what is the purpose to write this code using classes other than normal approch (using functions)....
@crowxar
@crowxar 5 ай бұрын
Classes make it easier to organize and change later rather then 1000 lines of clumped code
@rishabhagnihotri6004
@rishabhagnihotri6004 9 ай бұрын
Amazing !!
@cl4rkeyy
@cl4rkeyy Жыл бұрын
How do you reset/clear contents of the variables that are within a method within a class though?
@riccardoceolin7404
@riccardoceolin7404 10 ай бұрын
Can u explain how to open a new window from inside a class frame?
@valentinrafael9201
@valentinrafael9201 3 ай бұрын
The big problem with abstraction is that, you can't really do it from the get-go most of the time. If someone tries to get started with a GUI and go straight into abstracting first, and building functions second, they'll have a hard time debugging and a hard time when they get an idea while building and now they have to fit it in somewhere, or something didn't play out as expected. The sad truth is that, you kind of have to make a mess first, before doing it clean. After all, you can't "clean" unless it's dirty.
@chriskeo392
@chriskeo392 Жыл бұрын
Love it
@2002budokan
@2002budokan 11 ай бұрын
Is it possible to set window size relative to actual screen size? Another words is it possible to write responsive apps with tkinter?
@mbamuukatjiri2262
@mbamuukatjiri2262 Жыл бұрын
is it possible to write procedural programming code alongside object-oriented programming (OOP) in the same Tkinter project
@nkwilk513
@nkwilk513 8 ай бұрын
I have been following the video but I didn't see any colours, so I downloaded and copy-pasted your code and everything displays except the colours. What could my error be? macbook pro late 2012 running macos big sur
@nkwilk513
@nkwilk513 8 ай бұрын
I figured that on macOS I have to use ttk.Canvas if I want to display a colour
@ufuomamadagwa7785
@ufuomamadagwa7785 6 ай бұрын
i replicated the code and adde image as a button but it wont work
@vdi23
@vdi23 Жыл бұрын
I did it differently and it worked: from tkinter import * class App(Tk): .... class Menu(Frame): ..... And for widgets: Button() not ttk.Button Label() not ttk.Label() Is it okay or can various problems/conflicts appear in the development of an application?
@gedtoon6451
@gedtoon6451 11 ай бұрын
the link to the source code does not work.
@awlthatwoodcrafts8911
@awlthatwoodcrafts8911 21 күн бұрын
Classes are generally a better way to go. However, when it comes to a GUI interface, reusability becomes the main benefit, not just cleaner looking code. Imagine a portion of a window being common among several windows. It could be a menu structure or just a common text field that requires some validation of the user's input. As a class, it can be used over and over again and you only have to maintain that important logic in one place. This is a great tutorial, but he missed the opportunity to teach us the real reason why classes make better code for something like a GUI interface.
@Younes_SBIA
@Younes_SBIA Жыл бұрын
thank you
@natiadonay2104
@natiadonay2104 Жыл бұрын
are you beginner programmer like me?
@arataca3d
@arataca3d 6 ай бұрын
Thanks for this video _/\_
@lynny7868
@lynny7868 Жыл бұрын
7:50
@tehseenbaig3198
@tehseenbaig3198 11 ай бұрын
sir i have a question, i need to make buttons which can bring frames in the parent frame. means when we press the button we show frame, and further place buttons in that frame, to bring more frame. i cannot achieve this approach. please upload this kind of tutorial
@ermacheton
@ermacheton Жыл бұрын
My man, I am stuck on something, Since "Menu" class is somehow unrelated to the "Main" Class but instead share a common super class "App", i want a button on the "Menu" Class to call a method on the "Main" class, how do I do That since Main is not a child of Menu? Thanks for this amazing video!!
@nramananful
@nramananful 10 ай бұрын
sir, GoogMorning, i'm very beginner to Python you are explaining passing tk.Tk as argument in the Class App(tk.Tk) and you are passing self i.,e, tk.Tk, into menu = Menu(self) here self = tk.Tk ??, but in Class Menu(ttk.Frame), the constructor of Menu is def__init__(self, parent) i'm confusing, in class Menu(ttk.Frame) the argument should be tk.Tk how the ttk.Frame will come, in java not like this, can you clarify??
@Random_facts261
@Random_facts261 6 ай бұрын
while making this video, the owner of dog "michell" died
The grid layout method in tkinter
22:44
Atlas
Рет қаралды 37 М.
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Python Tkinter GUI Design Using ttkbootstrap - Complete Course
3:23:58
freeCodeCamp.org
Рет қаралды 349 М.
Tkinter - Modify Widgets From Different Classes
22:39
JobinPy
Рет қаралды 4,8 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 338 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
Make Modern Python Dashboards With Tkinter & Matplotlib!
15:54
TurbineThree
Рет қаралды 119 М.
Python Object Oriented Programming (OOP) - For Beginners
53:06
Tech With Tim
Рет қаралды 3,5 МЛН
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 1 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.