Python Weather Project (with GUI) - 1/16/22

This weekend I decided to dive into a short Python application project which I found on Youtube. I chose this project because I had never created an application with a GUI. Here I used Tkinter to build the GUI.

Application Summary

The application has a simple GUI consisting of a text field, button, and field to display information. I used PyInstaller to make a clickable executable which can run without requiring any installations on the user's part. It seems to look a little bit funky in that when you click it, two windows pop up. One being a blank terminal screen which has the icon I chose for the application. And, the other being the actual application window created with Tkinter.


The user's role is to enter a city into the text field and then press the "Get Weather" button. Then, the application displays some simple information about the weather in the city entered by the user using the OpenWeather API. If the user enters a city which does not exist on the API, a failed retrieval message will be displayed instead. The application displays at the ratio shown in these images, however it scales depending on how you grow or shrink the window.



My Questions

Inevitably, developing this type of application for the first time left me with some questions, which I will summarize here. Questions for some other weekend!
  • How can I create a clickable executable which only pops up 1 window and has the icon I choose?
  • How can I make my application window a fixed, unchangeable size? How can I tailor that to run on a variety of different systems?
  • How can I securely make use of any private API keys in an application?