Login

Lost your password?
Don't have an account? Sign Up

Tkinter Course – Create Graphic User Interfaces in Python Tutorial

Learn Tkinter in this full course for beginners. Tkinter is the fastest and easiest way to create the Graphic User Interfaces (GUI applications) with Python. Tkinter comes with Python already, so there's nothing to install!

?Code:

?Course created by Codemy.com. Check out their YouTube channel:

⭐️Course Contents ⭐️
⌨️ (0:00:00) Intro to Tkinter
⌨️ (0:10:32) Positioning With Tkinter's Grid System
⌨️ (0:19:29) Creating Buttons
⌨️ (0:29:30) Creating Input Fields
⌨️ (0:38:51) Build A Simple Calculator App
⌨️ (1:18:19) Using Icons, Images, and Exit Buttons
⌨️ (1:27:42) Build an Image Viewer App
⌨️ (1:49:37) Adding A Status Bar
⌨️ (1:59:45) Adding Frames To Your Program
⌨️ (2:07:49) Radio Buttons
⌨️ (2:24:36) Message Boxes
⌨️ (2:35:31) Create New Windows in tKinter
⌨️ (2:44:30) Open Files Dialog Box
⌨️ (2:56:09) Sliders
⌨️ (3:08:25) Checkboxes
⌨️ (3:17:29) Dropdown Menus
⌨️ (3:23:50) Using Databases
⌨️ (3:32:28) Building Out The GUI for our Database App
⌨️ (3:59:48) Delete A Record From Our Database
⌨️ (4:15:18) Update A Record With SQLite
⌨️ (4:42:57) Build a Weather App
⌨️ (5:04:32) Change Colors In our Weather App
⌨️ (5:16:36) Add Zipcode Lookup Form
⌨️ (5:26:22) Matplotlib Charts

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

And subscribe for new videos on technology every day:

https://www.educational.guru

48 comments

  1. Med SMATI

    Hello Mr John,
    I want to give you the explanation of the strange behavior of checkbutton when we use string value instead of integer value.
    the line of code concerned is:
    c = Checkbutton(root, text=”Check this …”, variable=var, onvalue=”On”, offvalue=”Off”)
    when you used an integer value, possibles values are 0 or 1, and the default value for integer is 0, it is why by default it is unchecked; but when you used string value and you defined the values “On” and “Off”, the default value for a string is an empty string “” which doesn’t exist between the 2 values you choosed; that means that the checkbutton starts with neither the value corresponding to unchecked nor the value corresponding to checked.
    To correct this, we can initialize the string variable with, for the example, “On” (if we want it to be checked initialy) or “Off” (if we want it to be unchecked initialy).
    var.set(“Off”)
    cordially

  2. Paul Taylor

    if anyone was wondering at 2:57:25 why the from_ parameter needs an underscore at the end, it’s because “from” by itself is a reserved word in Python (used in things like from Tkinter import messagebox, for example). Using a reserved word to have a completely different meaning would be problematic, so the developers of Tkinter added an underscore at the end to differentiate it from the original “from”.

  3. Kavin Umasankar

    Just a tip: When creating the calculator, in the button_click function, you don’t need three lines of code. The only line of code you need is e.insert(END, number). It works too.

  4. Mark Singh

    If anyone has trouble around 53:15, he’s using a lowercase “L” when he types out “lambda”
    For whatever reason, his text editor changes the font, and it just looks like a capital L.

  5. Paul Taylor

    note for around 1:02:04 when he decides to use a global variable: if you want to avoid using globals (and just make the whole calculator project a lot simpler), you could just have the calculator show the entire expression when you type it, instead of clearing the Entry field when one of the arithmetic operator buttons are pressed. This way, your program doesn’t need to remember anything, and can just read what’s in the Entry field when the equal button is pressed, and use eval(expresion_as_a_str) to evaluate the whole function easily.
    I’d also recommend making a function to create all the buttons so that you don’t need to copy basically the same line a bunch of times only to change the value and placement of the button.
    Using partials (from functools import partial, then command=partial(myFunction, argument)) is also a helpful way to pass arguments to the button commands.
    With all this, the calculator project becomes a lot shorter to code and has all the same functionality. I wrote one that supports addition, subtraction, multiplication, division, exponentiation, decimals, and order of operations in 50 PEP 8-compliant lines haha, and I’m sure it could be done in fewer!

  6. vin

    Although he does a lot of those ineffective “fixing a clock by putting a clock over a clock” thing, he is still pretty clear in his teaching. I’m very appreciative of that. Yes, It’s annoying to see something so simple become complicated, but for me it just leave a space for me to do better and applying skills I know to improve upon the projects.

  7. xavier9276w

    3:15:00 I think the reason why this is happening is because the var variable that we have created before, doesn’t have a value, but the c (checkbutton)’s variable is set to the var, because var doesn’t have value in it, so the checkbutton dont know what to empty var. If you set the var’s value by using var.set(“On”) / var.set(“Off”), the button will actually work as intended.

  8. Uzoigwe Chidera

    I don’t normally do this, but am forced to come back and say “THANK YOU VERY VERY MUCH” you mixed happiness with expertise, is so much fun watching your tutorials. I have subscribed already. A BIG THANK YOU ONCE MORE.

  9. Eliot Mayer

    Thank you John! The tkinter documentation on python.org left me feeling lost, perhaps even in over my head. But this lesson is very good, and now I feel like I can make Python GUIs! I coded along using VS Code, adding comments about the sometimes-tricky syntax needed for certain widgets. This leaves me with a great reference for future programs.

    At first, I was annoyed that John didn’t edit out his typo errors and subsequent corrections. But then I realized that this was more a “feature” than a “bug”, as it teaches how to interpret the Python error messages and such.

    Note: I skipped the sections “Using Databases” through “Add Zipcode Lookup Form”, as they are probably not relevant to me, so they are not covered by this review.

  10. Steve Juvesio

    this is the best tutorial ever… thank sir. i enjoyed the fact that you also used try and error. you weren’t sure at some things. that made me feel the liveliness of the lessons
    thanks so much…

  11. Chimdindu Onyia

    This was such a great tutorial on python GUIs. Happy I found this. I learnt overall, how to build GUIs, how to understand bugs and kind of correct them and as well, different programmatic approaches to creating solutions.

  12. ubant

    3:40:02 if someone has a problem here with *”AttributeError: ‘NoneType’ object has no attribute ‘delete'”*

    Don’t do
    l_name = Entry(root, width=30).grid(row=1, column=1, padx=20)

    but
    l_name = Entry(root, width=30)
    l_name.grid(row=1, column=1, padx=20)

    it works then

  13. Luis

    MAN! this saved my day, I’m totally new on py and this is awesome, I’ve been trying to figure out to do the same for some code I need to use while working and this is awesome!. appreciate it, awesome!

  14. Snoobab_86

    What an awesome free course! Thank you so much for this. Took me a while to work through it. But its brilliant the way you broke it up into bite size snippets so that I can do it bit for bit as I find time. Finally finished this and I am really enjoying playing with Tkinter.

Leave a Comment

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

*
*