The Weather Information Application is a simple Python GUI application built using the Tkinter library. It allows users to enter a city name and retrieve real-time weather information for that city using the WeatherAPI service.
- Input field to enter the city name.
- "Get Weather" button to fetch the weather information for the specified city.
- Real-time weather information displayed in a pop-up message box.
- Support for triggering the weather retrieval using the Enter key.
- Python 3.x
- Tkinter library (usually included with Python installations)
- Make sure you have Python 3.x installed on your computer.
- Clone or download this repository to your local machine.
- Open a terminal or command prompt and navigate to the directory where the repository is located.
- Run the following command to launch the Weather Information Application:
python main.py
- The application window will open, allowing you to enter a city name in the input field.
- Press the "Get Weather" button or simply press the Enter key to retrieve the weather information for the specified city.
- The weather information, including current temperature, feels-like temperature, wind speed, humidity, pressure, precipitation, and cloud cover, will be displayed in a pop-up message box.
To successfully fetch weather data, you need to obtain an API key from WeatherAPI. The API key should be added to the api_key
variable in the get_weather
function. Please make sure to replace 'YOUR_API_KEY'
with your actual WeatherAPI key.
def get_weather(city):
api_key = 'YOUR_API_KEY' # Replace 'YOUR_API_KEY' with the actual API key from WeatherAPI
# ....
- The application uses the WeatherAPI service to retrieve weather data.
This project is licensed under the MIT License.