Python GUI with Tkinter – 2 – Organizing your Layout

Python GUI with Tkinter – 2 – Organizing your Layout

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –

50 replies
  1. BasicCoding
    BasicCoding says:

    bucky what is the difference on your other GUI python tutorial? I think it was GTK? whatever but what’s the difference about it?

  2. Dario Komar
    Dario Komar says:

    I had a mental breakdown with WinAPI and C. After all those years, I decided to stop forcing myself to do stuff with C. Seeing this made me smile and gave me hope to code again. Thank you.

  3. MCDran
    MCDran says:

    It won’t work for me I normally have Python 3 but what ever

    C:Python27python.exe C:/Users/Mr.Retorofit/PycharmProjects/untitled/
    Traceback (most recent call last):
    File "C:/Users/Mr.Retorofit/PycharmProjects/untitled/", line 10, in <module>
    button1 = Button(topFrame, "Button 1", fg="Red")
    File "", line 2166, in __init__
    Widget.__init__(self, master, ‘button’, cnf, kw)
    File "", line 2085, in __init__
    cnf = _cnfmerge((cnf, kw))
    File "", line 116, in _cnfmerge
    ValueError: dictionary update sequence element #0 has length 1; 2 is required

    Process finished with exit code 1

  4. Tushar Mittal
    Tushar Mittal says:

    hey i am using python 3.6.1 and typed the same code as in the video but it gives an error – NameError: name ‘frame’ is not defined. Any suggestions on how to fix this ?

  5. Sajeesh Nair
    Sajeesh Nair says:

    Super clear explanation!!… I watched your first vid and it is awesome. I am trying to build a text editor as part of my project

  6. Chisolm Wilson
    Chisolm Wilson says:

    aside from the pronunciation of tkinter … its interesting that you dont pronounce your other T’s either. When you say root, it sounds like youre saying "roo". When you say but, it sounds like "buh". Anyway, Im enjoying the videos, thanks.

  7. Leonid Vishankov
    Leonid Vishankov says:

    none the less, i would recommend you to say it explicitly because it make the code more self documenting 4:31

  8. ΛLFΛ
    ΛLFΛ says:

    what i like about your videos is you don’t talk like a robot na na na … like a friend teaching me thats the reason i like your videos

  9. Minoan Light
    Minoan Light says:

    So, this is the thing, you say that top frame doesn’t have to be explicitly stated/defined, but on MacOS it HAS to be. Otherwise, it just won’t work, my window is empty. Still dunno how to get colored buttons to work, though.

  10. xegai hadgu
    xegai hadgu says:

    what is the site you using on this video called.? i tried to import tkinter in but for some reason it keep saying no module named tkinter found ….(is there any other sites like…..

  11. Hridoy Ahmed
    Hridoy Ahmed says:

    from tkinter import *

    root =Tk()
    topFrame =Frame(root)
    bottomFrame =Frame(root)

    button1 =Button(topFrame, text="Button 1",fg="red")
    button2 =Button(topFrame, text="Button 2",fg="blue")
    button3 =Button(topFrame, text="Button 3",fg="green")
    button4 =Button(bottomFrame, text="Button 3",fg="purple")



  12. Gamesys
    Gamesys says:

    Man you are amazing! Instead of just simply showing code and giving a tiny bit of shitty explanation you put the effort of showing us an example so we understand better. 🙂

  13. Ishmeet Bindra
    Ishmeet Bindra says:

    If someone is having a trouble in understanding how the framing works run the following code. In this, I have just added few commands to Frame and Pack to add additional padding around the two Frames.

    from tkinter import *

    root = Tk()

    topframe = Frame(root, bd=5, relief = GROOVE)
    topframe.pack(side=TOP,fill=X, padx=2, pady=2)

    bottomframe = Frame(root, bd=5,relief = GROOVE)
    bottomframe.pack(side=BOTTOM,fill=X, padx=2,pady=2)

    button1 = Button(topframe,text = "button 1",bg=’white’,fg = ‘black’)
    button2 = Button(topframe,text = "button 2",bg=’white’,fg = ‘black’)
    button3 = Button(topframe,text = "button 3",bg=’white’,fg = ‘black’)
    button4 = Button(bottomframe,text = "button 4",bg=’white’,fg = ‘red’)



  14. John Walker
    John Walker says:

    Why not just bottomFrame = Frame(root).pack(side=BOTTOM) ?
    btn1 = Button(bottomFrame, text="okay", fg="red").pack()

  15. Luiz Augusto
    Luiz Augusto says:

    Honestly I just give up PyQt5 cause it’s a mess, I think this Tk is made to be more simple and abstract.

  16. Nik K
    Nik K says:

    So he says that when you put side=LEFT, it packs it to the most left as possible, so why doesn’t button 2 just go to the very left and below button 1 (i.e it doesn’t just move the whole column to the left)


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *