Kedar Py 123
Kedar Py 123
Our project focuses on creating a user-friendly weather notification application using Python and
tkinter GUI toolkit. Leveraging the OpenWeatherMap API, the application fetches real-time
weather data based on user-provided city names. It features an intuitive interface with a text
entry for city names and a button to fetch weather information. Users receive immediate updates
on temperature, humidity, pressure, and weather descriptions, empowering them to make
informed decisions about their daily plans.
Prerequisites for Python Live Weather Notification
Project
Python Project File Structure
1. Importing necessary libraries and modules
import tkinter as tk
from tkinter import messagebox
import requests
import threading
import time
def show_weather():
city_name = city_entry.get()
api_key = "c319e74062fe9792cbe5db8ef2cce667" # Replace with your
OpenWeatherMap API key
if not city_name:
messagebox.showerror("Error", "Please enter a city name.")
return
root = tk.Tk()
root.title("Live Weather Notifications")
root.geometry("400x200")
window.
root for user interaction (Label for text, entry for input, button for