Object Oriented Tkinter

Поделиться
HTML-код
  • Опубликовано: 8 июл 2024
  • I'll cover how to use Tkinter using object oriented programming (classes) in Python. In this tutorial, I'll show you how to pass data from one window to another window. Each of those windows will be in a separate class. This will all be done without using global variables.
    #tkinter #python #python3
    0:00 Intro
    0:36 Classes explanation
    1:01 Demo code objective
    1:54 Create a root window
    2:30 Purpose of super()
    6:17 Create a toplevel window
    13:12 Run demo
    13:32 Closure
  • НаукаНаука

Комментарии • 41

  • @mhl1740
    @mhl1740 Год назад +1

    Thats the best Channel for Infos to TkInter I found on RUclips! You are the only one who shows how to organize code in a professional way. Thank you!

    • @jobinpy
      @jobinpy  Год назад

      Thanks for your kind words!

  • @johnlorefice976
    @johnlorefice976 Год назад +1

    I watched a few other videos from different people to clear up some of my confusion, and none of them broke it down and explained why I'm doing certain things. This video was very direct and explained what the other 5 videos failed to do. Great job and presentation!

    • @jobinpy
      @jobinpy  Год назад +1

      Glad it helped, thanks for watching!

  • @onlyeyeno
    @onlyeyeno Год назад +2

    Clear and concise, and well presented. Thanks for taking the time and effort of sharing :)
    Best regards.

  • @robinsonzapata1
    @robinsonzapata1 Год назад

    Great tutorial! many thanks

  • @fredflintstone8048
    @fredflintstone8048 9 месяцев назад

    Very good job of explaining instantiating classes and passing in variables.

  • @kingwill03
    @kingwill03 9 месяцев назад

    Good video Jobin. Thank you.

  • @marcelus4614
    @marcelus4614 5 месяцев назад

    Excellent video, thanks man!!

    • @jobinpy
      @jobinpy  5 месяцев назад

      Glad you liked it!

  • @sungjecho552
    @sungjecho552 Год назад

    Very lovely content ! Thank you...

    • @jobinpy
      @jobinpy  Год назад +1

      Thanks for watching!

  • @jaypower17
    @jaypower17 Год назад

    I love the way you teach ! very nice

    • @jobinpy
      @jobinpy  Год назад

      Thanks for watching!

  • @charlo193
    @charlo193 4 месяца назад

    thank you , keep going !

  • @rickyusuf8696
    @rickyusuf8696 5 месяцев назад

    Hi Jobin, I subscribed to your channel because of a previous video that I watched so I decided to check your other videos out, and to my surprise, this video resolved the very issue that I was having! Thank you so much! You are a great teacher.

    • @jobinpy
      @jobinpy  5 месяцев назад +1

      Awesome, thank you! Thanks for watching

  • @hardkorebhaktaofbob
    @hardkorebhaktaofbob 7 месяцев назад

    Bro you are the Bob Ross of Python Instruction!!!! Thanks! So so much!!!

    • @jobinpy
      @jobinpy  7 месяцев назад

      Thanks for your kind words!

    • @hardkorebhaktaofbob
      @hardkorebhaktaofbob 7 месяцев назад

      @@jobinpy When I watch a video often it means you did a fantastic job in engaging me. Great explanations. I learned more this time around. Thank You !

  • @olebaky9182
    @olebaky9182 Год назад

    learned a lot here. thanks

    • @jobinpy
      @jobinpy  Год назад

      Thanks for watching!

  • @AnkitKumar-lh8gm
    @AnkitKumar-lh8gm Год назад

    very nice video sir !!! Thank You

    • @jobinpy
      @jobinpy  Год назад +1

      Thanks for watching!

  • @user-ev5bx4wk3p
    @user-ev5bx4wk3p Год назад

    SHEEEEESHHHHHH the most effective teacherrrrr! SANA GANYAN RIN SI ROMAN HAHAHAHAHHAHA

  • @thepoorsultan5112
    @thepoorsultan5112 Год назад

    Nice intro

  • @cursos.prometec
    @cursos.prometec Год назад

    Hi Jobin, nice channel, itsd really useful for begginers like me. I am trying to make tkinter program reading an MQTT calback function to get values. Could you help explaining the basics for linking an external callback to tkinter normal loop event ?
    Thanks for all

  • @alanbrody3223
    @alanbrody3223 11 месяцев назад

    I'd like to have some more info about the frame you create in each class, why do you do that? Thanks, you have some very good content.

  • @andromilk2634
    @andromilk2634 4 месяца назад +1

    Is there a reason you passed a master to tk.Toplevel? (genuine question of a beginner) I saw in the options that it was optionnal, so couldn't you just have passed the username as the only argument without needing the master? Thanks

    • @jobinpy
      @jobinpy  4 месяца назад +1

      Good question. Not passing in master to tk.Toplevel is indeed possible (in most cases the toplevel window would make the first tk window the master automatically), but I always pass it for consistency and because I'm used to it.

  • @sovereignlivingsoul
    @sovereignlivingsoul 3 месяца назад

    good video, exactly what i was looking for, i am going to try and implement what you demonstrated in the coding of the program i am currently building, i would have appreciated it more if you had included how to input the data instead of hard coding it in, i have a solution for that, but i am positive yours would have been much cleaner, thanks again, i am getting a positional argument error

    • @jobinpy
      @jobinpy  3 месяца назад

      Glad it helped! I have another video related to getting the user's input from a separate window. The URL is: ruclips.net/video/QGtTHwn5xc4/видео.html

    • @sovereignlivingsoul
      @sovereignlivingsoul 3 месяца назад

      @@jobinpy i am trying to clear two inputs, entry.delete doesn't work, any suggestions, i have tried configure(text=" "), but doesn't do anything, the entries stack inside the input.

    • @jobinpy
      @jobinpy  3 месяца назад

      @@sovereignlivingsoulTry .delete(0, "end")

    • @sovereignlivingsoul
      @sovereignlivingsoul 3 месяца назад

      @@jobinpy yeah, tried that, problem is the data i want to remove is in a Label, so delete doesn't work and i can't find anything else that does, i will probably attempt to design some text inputs for my needs, if possible in tkinter and python, but thanks, good suggestion.

  • @carlospitcher4335
    @carlospitcher4335 Год назад

    This series of videos is clearly underrated.
    But in just a couple of days you passed from 460 to 570 subs... I hope you hit 1000 by dec 15th
    God Speed

  • @2002budokan
    @2002budokan 5 месяцев назад

    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.

  • @dgh25
    @dgh25 Год назад +3

    Why pass username as an argument? You could just go self.username = master.username...

    • @jobinpy
      @jobinpy  Год назад +2

      That's a good idea, thanks for sharing.