The need for the __init__ method and self parameter when inheriting with tkinter

preview_player
Показать описание
In this lesson I look at why you need the __init__ method and self parameter when creating an instance (object) of a subclass of the tkinter Frame class.
The links to the previous two videos are shown below:
Рекомендации по теме
Комментарии
Автор

Thank you so much! I've been struggling with this for days but this explanation made it click!

griggerykimothy
Автор

This is a deluxe explanation. It is not easy to get such a good explanation. Believe me. It will save you many hours trying to understand important and fundamental concepts about classes, in any language. So pay special attention to these topics here. Congratulations.

aaaa-khol
Автор

I was stuck for days on __init__, and this video helped me so much.
I already understood everything, or at least I thought I did, but in the end I was making one simple mistake that kept crashing my code -- confusing "self" and "window" as the same thing. When in retrospect it should have been clear that he window was the parent of the object and not the object itself.

Thank you. May the all mighty YouTube algorithim bless your channel.

shanerooney
Автор

Bravo. Expanding on the ID and SELF is something needed to drive the point home of the relationship between the two.

MaxGoddur
Автор

The best explanation of how objects are created. As someone making a journey from the social sciences into programming, I greatly appreciate the excellent explanations.

resrussia
Автор

A professor who has five information and can deliver it to the learner is better than a brilliant programmer who has 1, 000 information and is unable to deliver one to the learner...And you are a wonderful teacher

ibrahimibo
Автор

This explanation is so clear and straightforward. Thank you sir.

JohnCena
Автор

For those wondering the syntax to inherit from Frame class in python 2.(...) is:

Frame.__init__(self)

P.S. Fantastic videos on Tkinter. I wish there were more, since I'm nearing the end of the list.

sanjurotsubaki
Автор

Your videos are really good teacher quality. Better than some of the Udemy courses I've checked. One tip to help viewers. You could include in the description a link to the playlist the video is in. It would really help people stay on your channel.

handris
Автор

Hey John, Apologies if asking this question is redundant, but do you have any videos that explain the concept of using these Frame classes in regards to navigation? So for example, I want to create a Frame that is a Login screen, and then once a button is clicked, It changes the Frame to the next screen. I've been able to accomplish this very crudely by using .grid_forget() for all the elements of that Frame, and then re-establishing them when I need to navigate back. I would imagine that I could use something like frame_a.grid_forget then frame_b.grid(row=0, column=0) and then vice versa when navigating backwards. Am I on the right track?

crossfarm
Автор

This is really good. I would ask, however, if you are going to make reference to a previous video, please provide a link to it. I have know way of knowing which of your many videos is the 'previous' video. Thanks.

novicetech
Автор

please make a series on threading, gil and multiprocessing in python please give complete reviews on each topic sir

sudhirkaushik
Автор

I THINK I understand; but a sub class can be more useful if only we can add more attributes to it, otherwise we are only using it as a rubber stamp (to save lines of code; I can simply copy & paste the lines). I need to find out more about the purpose & objective of inheritance. Otherwise your explanation was methodical and graphics were useful. You have taken lots of pain in preparing the video. Thank you.

soundarapandian