39. GUI with TkInter, ISS and Kanye REST
1/11/2025
Using TkInter
Learning Python with Dr Angela Yu is never boring. During the last couple of weeks, I have been learning about GUIs in Python. It is amazing how advanced the technology is today, I mean - those interfaces they had before, looked chunky, thick compared to our slick, slim and super-intelligent programs now.
For the duration of the last weeks, we used the Tkinter. Tkinter - doesn’t only have a funny name, it can also do funny and cool stuff. I can only image how crazy interesting the times were when the people started thinking and developing tools like that.
I mean, they could interact with the screen though the User interface, and so they could do more, be more involved. The invention and evolution of the Graphical User Interfaces must have been a while revolution by itself.
I am learning that Xerox started in 1960. Ivan Sutherland's "Sketchpad" (1963) was one of the first graphical programs. And now we are merely touching our screens and things happen.
These are some of the things we did with Tkinter :
Pomodoro: we made an application that is using the Pomodoro Technique. This is basically a way to manage your efficiency : choose a task, work for 25 min, take 5-min break, repeat 4 times, take 30-min break at the end. The interesting part here was learning how to place an image as background, using Tkinter and then making the counter work.
Password Manager - for this one I learned how to use the grid, when placing elements on in the window, add dialog boxes and pop-up messages in Tkinter. This is a functional application, I am going to save my password there. We also implemented a Search functionality and with this occasion learned about the try catch except finally Pattern.
Flash Cards - language learning cards. This one I found a bit more complicated. At first, I started working on my own, and it was OK until I ran into an issue with the way I was reading the .csv containing the words. For this one, we're using pandas to read the .csv, Tkinter for the UI. Note to self : review list comprehension and working with pandas, for example: data.to_dict(orient="records").
Using smtplib
Motivational Emails - with this one, I learned how to use the smtplib module. It was fun to send motivational email to myself from Python.
BirthdayWisher - this one acts as a simple reminder program, it sends emails to yourself or directly to the people who are celebrating their birthday. We also used the datetime module here, to check if the date of today is the same as the date entered as the birthday.
Using Requests
Then I learned about making API calls in Python, with the help of the Requests module. I like what I’m reading here: Requests is an elegant and simple HTTP library for Python, built for human beings.
It makes me wish that all technology and programming languages were made for humans , hehe!
Kanye Quotes - was a funny project, where I used the https://kanye.rest/ API and Tkinter to display the quotes. Here is one of the pearls : “Tweeting is legal and also therapeutic” 🙂
ISS Overhead - This was an interesting project, we used 2 APIs :
- http://api.open-notify.org/ to get the location of the ISS right now and
- https://sunrise-sunset.org/api to check at what time is the sunrise and the sunset in a particular location.
Then we needed to check if the ISS is within my lat and long, and it is dark - you can only see the ISS from the dark, and then we email ourselves to look up! How cool is that !
The API providing the ISS location information was created by Nathan Bergey https://natronics.org/.
I really enjoyed learning and working on all the challenges the Dr Angela Yu is inventing. Sometimes I fail to solve the issues, which is ok, other times I do it differently than she does, which is ok.
Up next, I’ll continue learning about APIs but will add user authentication and much more. I’ll tell you about it next time!