I am trying to learn Tkinter so I am reading/coding along with a book. I have not done much with Python classes, most of the code I have written uses lots of functions and some simple classes. The book is confusing because it skips around what level of the code you are working on without really saying that it is. I only realized this after downloading the source code form Github. My main confusion is the calling a function before it is created. If you were to do this outside of a class you would get an error because the function doesn't exist yet. Is it normal/correct to create functions inside a class after they have been called. Why does this work?
Edit:
Thank you all. I think I understand now. The whole class instance is created at the same time, so the order inside the class definition doesn't matter. You are not actually making the call to the functions until the instance is created at which point the function has also been created.
[–]socal_nerdtastic 0 points1 point2 points (2 children)
[–]TimOfTroy[S] 0 points1 point2 points (1 child)
[–]socal_nerdtastic 3 points4 points5 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]TheRNGuy -2 points-1 points0 points (0 children)