Тёмный

How to Program a GUI Application (with Python Tkinter)! 

Keith Galli (KGMIT)
Подписаться 228 тыс.
Просмотров 946 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 873   
@KeithGalli
@KeithGalli 5 лет назад
Video Outline! 0:17 - What we’re ultimately building 2:05 - Getting started 3:16 - The basics of every Tkinter App (Root) 4:44 - Add a button to the screen 6:20 - Passing in keyword arguments 10:07 - Using frames to organize widgets 11:53 - Setting custom colors 14:00 - pack() to place widgets 17:39 - grid() to place widgets 19:53 - place() to place widgets 25:49 - Setting the appearance of our final application 33:45 - Adding background image 36:00 - Implementing button/entry functionality 39:49 - Connecting to the Weather API 43:29 - Making a GET request 51:36 - Formatting our response 56:24 - Changing Font and Font Size 59:58 - How to add weather icons to the app 1:01:36 - Making our App an executable using PyInstaller Hope you guys enjoyed! Make sure to subscribe if you haven’t already :)
@klausbauer2435
@klausbauer2435 5 лет назад
Could you do a video about web development with python or at least recommend something?
@texanniner
@texanniner 5 лет назад
@@klausbauer2435 I've used Flask with success.
@subhammitra1218
@subhammitra1218 5 лет назад
How to show all the things like pressure, humidity etc in the final output display??
@imcoder6969
@imcoder6969 5 лет назад
great job dude keep it up man!! keep it up!!
@mashraful5065
@mashraful5065 5 лет назад
Will I need Python Tkinker to build the application???
@kckph4264
@kckph4264 5 лет назад
Finally, i programming tutuorial from someone with a sense of humor and a voice thats louder than 2db, and the tutorial is really understandable
@matheusjanczkowski9107
@matheusjanczkowski9107 2 года назад
And is not speaking fucking broken English with Indian accent...
@nikothenoob
@nikothenoob Год назад
first reply?
@jdsguam
@jdsguam 3 года назад
I'm a 66 yr old and was not going to try learning python; but this video got me interested and running down the rabbit hole. Nicely Done!
@charlietame1892
@charlietame1892 5 лет назад
Definitely the best tutorial yet. I'm not exactly a novice but the fact that you took your time explaining "Why" you chose to do things a certain way was for sure something missing from other tutorials and will help a lot of people.
@ArtuursPaulausks
@ArtuursPaulausks 5 лет назад
It is much easier to understand when a person explains syntax in his own words. Awesome video, thanks !
@ivanllopis5882
@ivanllopis5882 5 лет назад
This is the best video on Tkinter I've ever seen. Thank you so much, I'm definitely sharing this one with whomever may find this useful. Good work!
@KeithGalli
@KeithGalli 5 лет назад
Glad you enjoyed, and thanks :)
@moletsanephillipmakhate5305
@moletsanephillipmakhate5305 4 года назад
I also agree with this sentiment
@truepenny2514
@truepenny2514 2 года назад
This was the second video of yours I’ve watched and I’ll be watching more. You speak *naturally* - you’re not reading from a script or mumbling; it’s like I’ve just sat down with you and you’re showing me something. Also, when stuff doesn’t happen just right the first time - that’s VERY real life - you’re modeling what to do - don’t panic just go back over stuff and figure out what you did wrong. Easy-peasy! I love this style of teaching, thanks.
@direndeniz8817
@direndeniz8817 Год назад
He is teaching us by learning simultaneously which makes the video more natural. That's why I subscribed to him... Great job Keith. Keep going. Greetings from Turkey...
@AspartameBoy
@AspartameBoy 5 лет назад
The documentation "out there" is not very effective. Your video is super.
@TheKhashix
@TheKhashix 5 лет назад
You're a wonderful teacher. Only just getting started in Python and you manage to make all the concepts incredibly easy to understand. Not only that, you're always going in and explaining why you're doing something, providing a real kick-start to the learning process. Thank you for uploading this!
@maniac1814
@maniac1814 4 года назад
What makes this tutorial better than any other tutorials on tkinter I have seen is, that you import the module as tk and not as * so that one can distinguish the tk calls from all the other stuff at first sight. You also don´t put everything in a class like many tutorials out there which only complicates things. I haven´t seen anyone else describe the place-function - which is a great tool to make the gui look professional.
@Phoenix-to2no
@Phoenix-to2no 4 года назад
I realise this is literally a year after you posted it but it is still the best source I've found for learning how to use Tkinter. Thanks :)
@KeithGalli
@KeithGalli 4 года назад
Well I still usually see the comments :). Glad you enjoyed!!
@VarunSridharan91
@VarunSridharan91 4 года назад
This i can guarantee is the fastest and clearest way to learn the basics of interactive GUI python programming and API calls. Beautifully done tutorial! Many thanks , God Bless.
@adlerdoesstuff1872
@adlerdoesstuff1872 2 года назад
Hands down best coding tutorial I have ever seen
@ActuallyAudacity
@ActuallyAudacity 5 лет назад
For people trying to this program while following him along, if you're not using sublime text you may have problems with the request function. In order for it to work go on command prompt and type "pip install requests" and then go to your code and "import requests". Hope this helped if you were stuck on this!
@Redagrandrei
@Redagrandrei 5 лет назад
Thanks man
@Stellarspace95
@Stellarspace95 5 лет назад
dang, I read your comment and when I ran into the issue I remembered you posted this so thanks lol
@ActuallyAudacity
@ActuallyAudacity 5 лет назад
@@Stellarspace95 No problem :D Glad it helped some people out because I had this problem as well and was very confused
@lokeshkumarw9045
@lokeshkumarw9045 5 лет назад
why did people have this problem? He mentions in the video about installing "requests" and then imports it as well!! :/ Edit: installs at 2:30 imports at 44:00
@ActuallyAudacity
@ActuallyAudacity 5 лет назад
@@lokeshkumarw9045 Could you put the time please? I may have missed it.
@patrickmbarker
@patrickmbarker 5 лет назад
Thanks Keith, I learned a lot in this one. I started learning programming with Java in college, but I am finding Python much more fun to work with. I've finally got that motivation back for programming.
@thebeston6710
@thebeston6710 4 года назад
You are one of the best programmers ever!!!!!!! This helped me learn tkinter a lot!!!!
@Nunya58294
@Nunya58294 2 года назад
One of the best tutorials I've seen for this.This also helped me understand frames a lot more with a visual rather than just explaining
@maximilianschmid2644
@maximilianschmid2644 4 года назад
If you have problems loading the pic on a mac, try importing: from pathlib import Path then define the image path: image = Path('*your folder1*/*your folder2*/*your folder3*/*your_pic.png*') After that just add file=image: background_image = tk.PhotoImage(file=image) Thanks for the vid, Keith!
@AlbertLeng
@AlbertLeng 4 года назад
I had a hard time reading the "official" documentation as I guess it's not really well-maintained and updated. Following your video is such an efficient and effective way to kick start my Tkinter learning. Good job brother!
@GoodBoyDanny
@GoodBoyDanny 4 года назад
this is the best coding tutorial I have ever listened to
@joeythompson2375
@joeythompson2375 4 года назад
Thank you, Very thoughtful of the viewer. Hat tip to you sir on tutorials point. wow a goldmine. I appreciate the honesty in showing that a huge part of this is looking up things. When I started watching coding videos , I was scared I would need to memorize an encyclopedia. Big confidence boost here.
@RubikMaster13
@RubikMaster13 3 года назад
One of the best tutorials I've ever seen. Just the right level of information, and you actually show where you get everything from!!
@jeremythompson8697
@jeremythompson8697 5 лет назад
Really enjoyed your cool, calm and casual style - taking us through the "Design-Time" before run-time with a realistic demo was a great intro. Keep up the good work!
@Ouzzel
@Ouzzel Год назад
I came here just to learn the GUI, but also needed help with API also so this was really helpful.
@baksagimm5890
@baksagimm5890 5 лет назад
Best tk tutorial out there! Thankyou. I was struggling with overcomplicated official docs.
@KeithGalli
@KeithGalli 5 лет назад
Happy it helped! :)
@cv6593
@cv6593 4 года назад
This was extremely helpful for me - I was able to follow everything and build my own front-end database form connected to SQLite just by using your tutorial as a template. Much appreciated!
@rafalpilewicz5545
@rafalpilewicz5545 4 года назад
hi Chris, can you show how your front-end database looks like? I would appreciate it. Thx
@justinmcdonald1930
@justinmcdonald1930 4 года назад
If you'll getting a syntax error with the "Lambda:" code, try using lowercase L in "lambda:"
@LittleRapGuy
@LittleRapGuy 4 года назад
It was a good idea to make the breakfast sandwhiches available at all hours. :0
@joshcarz
@joshcarz 4 года назад
omg thanks
@msctube45
@msctube45 4 года назад
Thank you for the hint!
@gobstopr1
@gobstopr1 4 года назад
Thank you!
@ericmikolajski1082
@ericmikolajski1082 3 года назад
oh my lord, you dont know how much that frustrated me, thaaank you
@SS-bb1nc
@SS-bb1nc 4 года назад
Thanks for actually explaining the positioning methods. Strange, but I dont think any of the tkinter tutorials I watched before even mentioned place(), and its the most useful in my opinion. Best tutorial I've watched so far. You deff got a new subscriber
@muhammedalidilekci4585
@muhammedalidilekci4585 3 года назад
Thanks for being perfect. I am following you & sharing your videos with my friends from now on. This was really one of the best tutorial videos I've ever seen. You don't sound like a cold teacher, you describe things in your own words rather than definitions as much as possible, you are explaining the reasons behind your actions and choices , your sound is clear and understandable. Thanks for the video , keep up the good work bro.
@AjaySingh-mu5ik
@AjaySingh-mu5ik 3 года назад
I love the way you explain with help of google . it motivate me that google is available for your help. You explain how to use it. And your tutorial is always base on a project. which describe how things happened.
@niyousha6868
@niyousha6868 4 года назад
You are one of the most genius people I know in the USA, you are not a silly American Keith (referring to what you said at 45:30). Also, thank you for this tutorial.
@danmcginnis9933
@danmcginnis9933 4 года назад
Keith Thank you very much for taking the time to go over the details of what the code does and how it works. This was very helpful
@Ardrysto
@Ardrysto 5 лет назад
lmao the moment he pressed the button an ad started playing and I was super confused
@Zephyr-tg9hu
@Zephyr-tg9hu 3 года назад
nice lol
@owensweitzer8270
@owensweitzer8270 4 года назад
Hey y'all, heads up as you're going through: The background pic can't be jpg
@hippolytelapierre3475
@hippolytelapierre3475 4 года назад
ze ddz why you so agressive 😂
@enzoqueijao
@enzoqueijao 4 года назад
@@opus_X I'm curious too! If people don't answer, I'm gonna get mad as well!
@Jam-iv6xz
@Jam-iv6xz 4 года назад
Thank you friend
@niyousha6868
@niyousha6868 4 года назад
thank you
@maheshpishe6116
@maheshpishe6116 4 года назад
you need to install pillow library for adding .jpg images
@Kedoorsie
@Kedoorsie 5 лет назад
I am only at 14:05 now, but have to say that so far you have explained it brilliantly, with so many additional resources. Glad to subscribe!
@mohitjain4943
@mohitjain4943 5 лет назад
Love From India Mate! :) i have been watching all your videos. Love your Videos man... Please Bring More videos quickly We wait for a Long time!
@KeithGalli
@KeithGalli 5 лет назад
I appreciate the support mohit! I'm sorry that I've been taking a long time to post new videos. I've been very busy with school/work. Will try my best to get them out quicker, but no promises.
@MmmBopsPops
@MmmBopsPops 5 лет назад
Never knew why lambdas were needed in JS as well for setTimeouts and stuff, but now it makes sense. Thanks!
@thebandwidth
@thebandwidth 4 года назад
The best programming video i have ever watched on RU-vid The professional teacher should learn from him
@guilhermezucco1269
@guilhermezucco1269 3 года назад
I'm watching this from Brazil, and I can honestly say that this is a great video. Along with sense of humor, this tutorial is filled with good content and also showcases handy line codes. It's my first time studying GUIs, btw
@Nurgle1977
@Nurgle1977 5 лет назад
Thank you for taking the time to do this. I am just beginning out in python, I enjoyed doing this project. Also it is amazing how a wrong letter is hard to find, lol.
@FEADith
@FEADith 4 года назад
I really like your video cos u also show the documentation and showed us where to find something.. so we can explore deeper on our own. Thanks.
@chrisw5509
@chrisw5509 3 года назад
Fantastic video! I am a beginner programmer, lol - more like a “wanna be” programmer. I started with Python and the related GUI Kivy. Your video enabled me to get a grasp on using API with Python. However, I was challenged by translating your Tkinter GUI into Kivy. I succeeded and created a Kivy Weather App. In connection, I only used one Python function / method. For my purposes and limited experience, I found using one function preferable. I have subscribed and intend to view more of your videos. Please keep up your efforts. I really appreciate your videos!!
@VainerCactus0
@VainerCactus0 5 лет назад
Thanks for this. Was my first time coding anything using the requests module, so it was very helpful.
@lilystar5
@lilystar5 5 лет назад
VainerCactus 0 my import requests doesn’t work, it says “there’s no module named ‘requests’
@VainerCactus0
@VainerCactus0 5 лет назад
@@lilystar5 You know when you import random or import tkinter? import requests is the same, except requests does not come with the standard python instal. You need to download it off the internet. There should be some command for that, but it is too early for me to remember that. Just google pip instal requests and see what you come up with. There are a whole bunch of libraries and modules you can download from the internet.
@muhammadusamaamin2845
@muhammadusamaamin2845 5 лет назад
Thanks a lot! It helped me very much to learn the basics of python functions. I was having some issues in getting temp in Celsius, I resolved it by conversion from Fahrenheit to Celsius. I completed it just before adding icons.
@mivoe99
@mivoe99 5 лет назад
Really good tutorial. Thank you for getting me started in Python and not over simplify every step you take.
@folarinodejayi
@folarinodejayi 4 года назад
Thank you so much for this Keith!! I completed my Stanford crash course project with this! means a lot!
@thelamarcke
@thelamarcke 4 года назад
This is a really nice tutorial, you even introduced me to APIs, which i've been looking to for quite some time. Thanks and keep the good work
@AndrewKiethBoggs
@AndrewKiethBoggs 4 года назад
Thank you for providing quality content. My friends and I are learning python and your channel has been beyond amazing. I will be recommending you!
@twnfaem
@twnfaem 5 лет назад
Absolutely excellent tutorial! If you're planning on doing any more tutorials in the future: do 'em like this! Thanks and appreciation from Belgium :)
@sagarentertainmenthub5181
@sagarentertainmenthub5181 2 года назад
I made my fist GUI after watching this, thanks a lot bro, love from india🤩
@meliodas4560
@meliodas4560 4 года назад
Finally... This might be the first time I've heard someone mention "magic numbers" and why not to use them since my formal education years ago... Great vid :)
@eldricktrujillo4329
@eldricktrujillo4329 4 года назад
Great video, i just have finished a beginners course and this is awesome, thanks bro!
@sandeepsharma-ph8id
@sandeepsharma-ph8id 4 года назад
One of the best videos. Thanks Keith. Learning couldn't be so simple.
@aidenyang1286
@aidenyang1286 5 лет назад
Dude, keep it up . Your video is quick, straight to the point. Love it. Thanks
@mbonuchinedu2420
@mbonuchinedu2420 4 года назад
Exactly what i needed now in python, and Keith Galli came to the rescue. Thanks Keith, more grease to your elbow
@aravindantr4499
@aravindantr4499 5 лет назад
Woww...I love the way you teach us please upload more videos based on tkinter GUI
@BrannenTaylor
@BrannenTaylor 4 года назад
Thanks for the video! Very helpful. One small mod I added was being able to hit after the city. entry.bind("", (lambda event: get_weather(entry.get()))) # the entry.bind above, will allow the return to be pressed - same as clicking button.
@Blankiezisnotafard
@Blankiezisnotafard 2 года назад
Awesome video keith! Looking forward to more!
@corkerydan
@corkerydan 4 года назад
Very good video. Thanks. I avoided tkinter for years for a qt builder. It's a little bit longer to design but good to know. Good work.
@phantomf41
@phantomf41 5 лет назад
Best video on tkinter and really entertaining to listen to this dude.
@bonkgta1131
@bonkgta1131 3 года назад
Finally an AMAZING programming tutor!
@GiovanniGirelli1104
@GiovanniGirelli1104 Год назад
Thanks! Very cool! I followed along and was able to build another kind of app based on this tutorial.
@bisratgetachew8373
@bisratgetachew8373 3 года назад
We need you back man. Hope you make your return soon. Thanks again
@frikkievandermerwe
@frikkievandermerwe 5 лет назад
Awesome tutorial man! Really enjoyed it - easy to follow along. The way you used "place()" function with relative positioning and sizing is something I have been searching for... I had been playing around with Kivy but always hoped Tkinter could do what I wanted. Tonight you showed me how. Thanks man :)
@purple_rhino
@purple_rhino 4 года назад
If your getting Pillow doesn't works properly, you might want to reinstall python, making sure that when you reinstall, you check the box that says 'Copy to path' or something along those lines. Helpfully saves a lot of frustration.
@kristypolymath1359
@kristypolymath1359 5 лет назад
This guy is good! You deserve more views and subscribes! :D
@ajitkumar-pr3ep
@ajitkumar-pr3ep 4 года назад
if any of you having a trouble with image display try importing from PIL import ImageTk, Image and then using background_image = ImageTk.PhotoImage(Image.open('your.png')) it worked for me
@noellekkar903
@noellekkar903 4 года назад
Whoa, thanks a lot. It worked for me
@roberteagly3349
@roberteagly3349 4 года назад
I'm sorry I am new to python. Could you show an example? I am using spyder, I typed exactly what Kieth typed but I get an error in regards to the background image.
@videepsingh1805
@videepsingh1805 4 года назад
Hi, I tried using what you said, and though the program didn't crash, The image didn't load up, it showed all the rest of the components(the labels, button and entry) but not the background image
@fredflintstone2305
@fredflintstone2305 3 года назад
@@videepsingh1805 Same here.
@edenamir5825
@edenamir5825 4 года назад
This is awesome!!!! I'm a beginner and it was so fun to watch. you made it look so simple and explained it very cllearly. thank you
@cooperm590
@cooperm590 4 года назад
Thanks for the tutorial, even though I used it to create a GUI for a game bot, your tutorial was very useful. keep up the good work man
@MrSYLVESTER444
@MrSYLVESTER444 5 лет назад
super helpful man.....much love from Nigeria
@symbolorate
@symbolorate 3 года назад
an awesome short project I leaned a lot from it thanks Keith
@Obzen88UK
@Obzen88UK 4 года назад
Great tutorial, a few little blips here and there but you taught me a lot, so thank you and keep doing what you’re doing!
@jonnymacn9457
@jonnymacn9457 4 года назад
It helps when you show your mistakes because learners such as myself can see how to solve their own code from mistakes, thanks
@joephinazee5422
@joephinazee5422 4 года назад
Thanks for the video Keith. Everything was well explained and I was able to follow along just fine.
@grand2938
@grand2938 3 года назад
the best channel
@NarenderSinghRai
@NarenderSinghRai 2 года назад
thanks.. it helped me to complete my project
@sskengineering8474
@sskengineering8474 3 года назад
Subscribed bro!!!!! Thank you for the video my g!! love from east London
@KeithGalli
@KeithGalli 3 года назад
You're very welcome :). I appreciate the subscription!
@michaela.thompson8986
@michaela.thompson8986 2 года назад
What is that screen you left up at the end of your video (the one where you were PIP things into? I'm using Windows. Great video and I enjoyed your thorough explanations and the why you did things. A lot of other tutorial videos seem to lack the why, they seem more interested in just showing the how. Keep up the great work. My only suggestion is to create a list of your videos (in order from start to the latest). Just starting out in Python and "stumbled upon this video as a "suggested video" by RU-vid. Really enjoyed it. Thank you.
@MariaSantos-bw7uh
@MariaSantos-bw7uh 3 года назад
This is exactly what I was looking for, it really helped a lot!! Thanks!
@xskodemedia746
@xskodemedia746 5 лет назад
dude, you audio is clear and crisp! (it's been awhile since ive watched a tutorial with clear and crisp voice lol) is it the microphone or your audio editing skills that makes the audio sound great!?
@KeithGalli
@KeithGalli 5 лет назад
Thanks man! It's a combination of my Sony mirrorless camera equipped with a Rode microphone. As long as the audio recording levels are set well, the audio comes out very crisp!
@nagendravishwamitra3652
@nagendravishwamitra3652 3 года назад
I really understood Tkinter now ... Can you please make a video on tkinter to search a specific row in a excel n also on multiple dependent search
@vaelinalsorna1649
@vaelinalsorna1649 4 года назад
Thanks for the tutorial. I have been learning tkinter from other yoututbers and have read the docs but couldn't find a solution to make sure my widgets resized when you mess around with the window. Searched stack overflow and the official tk docs that recommended using grid_propagate(0) then adding 2 arguments (arg, weight=1) to rowconfigure and columnconfigure with weight being the supposed solution to my problem. Well, it didn't work. :/ Thankfully, I stumbled upon your video explaining how place() works instead of using pack() and grid(). Really appreciate the video. Keep up the great work. You've earned a new sub. 🙂
@enayatharia
@enayatharia 4 года назад
Finally I got how to work with API, thanks!
@patrickwarren
@patrickwarren 4 года назад
Thank you for the explanations as well as the timeline! Wonderful video
@P3ace1oveUn1ty
@P3ace1oveUn1ty 3 года назад
Great Video Keith, thank you! I learn so much from these. When using pyinstaller, add a -w flag and it will get rid of the blank window for Windows users. pyinstaller.exe --onefile --icon=sun_icon.ico -w WeatherApp.py
@sammathew243
@sammathew243 5 лет назад
Would be good that you follow this up with a GUI building using PAGE, which is WYSIWIG drag-n-drop GUI builder that gives you the Tkinter code, once you built your GUI.
@buuqmarabo2778
@buuqmarabo2778 5 лет назад
your app looks modern! it's not true what people say about ttk after all but i am into Qt for python (PySide2) right know and hope you do tuts on that since no one do that. thanks!
@Kizmaaa
@Kizmaaa 3 года назад
finnaly a tutorial that is making me can wrote my own program thanks:)
@AbootGaming
@AbootGaming 5 лет назад
Thanks dude! I just started python last week and made my first app! I was really struggling with tkinter!
@robinsonzapata1
@robinsonzapata1 3 года назад
Great tutorial, showing documentation too!
@jozsefolasz8702
@jozsefolasz8702 5 лет назад
That is exactly what a beginer needs. Thx!
@pastorsamarpan
@pastorsamarpan 3 года назад
Thanks Keith for Amazing Video. Learning a lot!
@renaudd1910
@renaudd1910 3 года назад
hilarious video intro... Just as I hit play, my wife walks in, rolls her eyes and shakes her head... and I'm like... but I'm learning coding
@nandaa1982
@nandaa1982 2 года назад
wow with this vidio I am making weather forecaster and helpful too
@CarlFritz24
@CarlFritz24 3 года назад
Somehow... there's a problem somewhere in the code structure because it doesn't work as we would expect. Anyway, besides the space you occupy in the video (better used to magnify the code lines...) I think you did a good job.
@isabellaborkovic2448
@isabellaborkovic2448 3 года назад
you are awesome may your soar high and reach the stars
@syremusic_
@syremusic_ 4 года назад
Awesome video. Super clear and easy to follow. Thank you!
@kubajba5521
@kubajba5521 5 лет назад
great tutorial! thanks man, you've helped me a lot ;)
@ssgrandtv887
@ssgrandtv887 4 года назад
Thanks l built the whole thing and it worked now everyone is asking me how l did it thanks man
Далее
Solving real world data science tasks with Python Pandas!
1:26:07
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Просмотров 928 тыс.
The Value of Source Code
17:46
Просмотров 49 тыс.
Desktop GUI App With Python & Tkinter
56:39
Просмотров 387 тыс.
Modern Graphical User Interfaces in Python
11:12
Просмотров 1,5 млн
NSURLProtocol: How I Stole an App For My Wedding
56:25