Tkinter Course – Create Graphic User Interfaces in Python Tutorial
August 3, 2024 2024-08-03 18:59Tkinter 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: https://github.com/flatplanet/Intro-To-TKinter-Youtube-Course
🎥Course created by Codemy.com. Check out their YouTube channel: https://www.youtube.com/c/Codemycom
⭐️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: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
source
Comments (24)
@Bessadi777
GOAT
@brianfuller2241
If you want a good running start at Tkinter then this video is worth your time. Thank you John Elder for building and making your zillion other videos available for either no cost or beyond reasonable low cost.
@useronthegrind
great course man… respect!
@useronthegrind
Hey guys, I made this calculator… check it out pls…
———————————————————————————————
from tkinter import *
root = Tk()
root.title('Completely Non-Sus Calculator')
# all variables
button_size = 21
previous_num = 0
add_nums = False
sub_nums = False
mul_nums = False
div_nums = False
# defining the required functions here
def addition():
global previous_num
global add_nums
first_value = e.get() # 3
previous_num += int(first_value) # 3 – 6
e.delete(0, END)
add_nums = True
return int(previous_num)
def subtraction():
global previous_num
global sub_nums
first_value = e.get()
if previous_num == 0:
previous_num += int(first_value)
else:
previous_num -= int(first_value)
e.delete(0, END)
sub_nums = True
return int(previous_num)
def multiplication():
global previous_num
global mul_nums
first_value = e.get()
if previous_num == 0:
previous_num += int(first_value)
else:
previous_num *= int(first_value)
e.delete(0, END)
mul_nums = True
return int(previous_num)
def division():
global previous_num
global div_nums
first_value = e.get()
if previous_num == 0:
previous_num += int(first_value)
else:
previous_num /= int(first_value)
e.delete(0, END)
div_nums = True
return int(previous_num)
def button_click(number):
current_num = e.get()
e.delete(0, END)
e.insert(0, str(current_num) + str(number))
if number == 'delete':
e.delete(0, END)
global previous_num
previous_num = 0
def button_equal():
global add_nums
global sub_nums
global mul_nums
global div_nums
global previous_num
if add_nums:
first_num = e.get() # 1
e.delete(0, END)
previous_num += int(first_num) # 6 – 7
e.insert(0, previous_num)
previous_num = 0
elif sub_nums:
first_num = e.get()
e.delete(0, END)
previous_num -= int(first_num)
e.insert(0, previous_num)
previous_num = 0
elif mul_nums:
first_num = e.get()
e.delete(0, END)
previous_num *= int(first_num)
e.insert(0, previous_num)
previous_num = 0
elif div_nums:
first_num = e.get()
e.delete(0, END)
previous_num /= int(first_num)
e.insert(0, previous_num)
previous_num = 0
add_nums = False
sub_nums = False
mul_nums = False
div_nums = False
# define your buttons
e = Entry(root, borderwidth=5, width=35)
e.get()
button1 = Button(root, text='1', padx=button_size, pady=button_size, command=lambda: button_click(1))
button2 = Button(root, text='2', padx=button_size, pady=button_size, command=lambda: button_click(2))
button3 = Button(root, text='3', padx=button_size, pady=button_size, command=lambda: button_click(3))
button4 = Button(root, text='4', padx=button_size, pady=button_size, command=lambda: button_click(4))
button5 = Button(root, text='5', padx=button_size, pady=button_size, command=lambda: button_click(5))
button6 = Button(root, text='6', padx=button_size, pady=button_size, command=lambda: button_click(6))
button7 = Button(root, text='7', padx=button_size, pady=button_size, command=lambda: button_click(7))
button8 = Button(root, text='8', padx=button_size, pady=button_size, command=lambda: button_click(8))
button9 = Button(root, text='9', padx=button_size, pady=button_size, command=lambda: button_click(9))
button0 = Button(root, text='0', padx=button_size, pady=button_size, command=lambda: button_click(0))
clearAll = Button(root, text='C', padx=button_size, pady=55, command=lambda: button_click('delete'))
equalsTo = Button(root, text='=', padx=button_size, pady=55, command=button_equal)
add = Button(root, text='+', padx=button_size, pady=button_size, command=addition)
subtract = Button(root, text='-', padx=button_size, pady=button_size, command=subtraction)
multiply = Button(root, text='*', padx=button_size, pady=button_size, command=multiplication)
divide = Button(root, text='/', padx=button_size, pady=button_size, command=division)
# put the buttons on the screen
e.grid(column=1, row=1, columnspan=4)
button1.grid(column=1, row=3)
button2.grid(column=2, row=3)
button3.grid(column=3, row=3)
button4.grid(column=1, row=4)
button5.grid(column=2, row=4)
button6.grid(column=3, row=4)
button7.grid(column=1, row=5)
button8.grid(column=2, row=5)
button9.grid(column=3, row=5)
button0.grid(column=2, row=6)
clearAll.grid(column=4, row=3, rowspan=2)
equalsTo.grid(column=4, row=5, rowspan=2)
add.grid(column=1, row=2)
subtract.grid(column=2, row=2)
multiply.grid(column=3, row=2)
divide.grid(column=4, row=2)
root.mainloop()
—————————————————————————————–
@lisadykstra8308
Why not use Visual Studio Code, where you can run the program in the same window instead of switching back and forth? It's frustrating because I'd like to see the coding screen to still be typing it out in my own window when he's taking the time to run it.
@angelicagabrieli7169
Thank you so so much for this informative and awesome course! God Bless you, brother!
@hdbnrw6442
Mehr sinnfreies gequatsche als alles andere
@VictorVictory-te2ij
Thank you so very much Sir!
@Minemario6
For cleaner code at around 56:11, you can just replace the 0 with END like this.
e.insert(END, num)
@mineplantvn5271
Dont wanna say this but bro looks like Walter White
@DragonHatchery
I'm a simple hobbyist, and wanted to learn tkinter. I found this and the 5 hour length seemed like it would give me some depth, so I plunged in. I typed in every line he wrote, over about two weeks. Here are my conclusions…
1) Thanks to the author. This is a huge set of videos and I achieved what I set out to do – I became literate in tkinter
2) I'm writing this in 2024. These videos do NOT cover ttk (themed tkinter widgets) If you want the new, more modern looking interface (and you probably do) you'll have to learn it separately. It's not a whole lot different, so the videos still are quite useful
3) He's largely "winging it." He knows his subject very well, but everyone makes mistakes, and you'll spend a fair amount of time watching him correct his mistakes. Editing would have been appreciated, but hey, the price was right
4) As you enter your programs, you will also make errors. The timeline on the bottom of the video is almost 6 hours, so trying to tap on it and go back to see what he said and wrote is difficult — you can't be accurate enough with your mouse, and you'll spend more time than you want hunting and listening to things you've already heard.
5) By the end, I suspect he was getting pretty sick of the detail, and the last few lessons are a bit hard to follow. He moves fast.
6) When you're done, you'll have a pretty good introduction to tkinter.
7) All in all, worth your time and effort. Thanks again to the author.
@Drapoels
3:05:36 on this scales insted of pack() I used grid() and it wordked
@pincer2885
help my thing says Tk is not defined
@m4rzb4rz-qq3yq
Absolutely recommended 2x speed
@1guldemirel
I'm building the database section just like in the video, but when I run it, a window appears briefly and then disappears. What could be the reason for this?
@155.p.vijayaraju5
hey
@kapibara2440
Many thanks for the brilliant tutorial❤❤❤
@koiiok-fe8ob
!pelo
@NotEnoughTime-cf2pi
Why do you not use toplevel when you create the new update record window (function edit() in address database but create another instance of tk?
@Nikita_Yudin_V
7:00
@bobvance9519
I wish you had covered filedialog.asksaveasfile().
@pizzagod7972
2:50:51 bro the voice.
@bhangrafan4480
Are you a son of Katie Elder? Oh… You heard it before.
@user-bf2ek2um9c
4 years has beenpassed still the best video