Spaces:
Build error
Build error
Download app.py from tharunk07/WeatherDetect: direct link, hf CLI and curl.
- Browser
- Download file 711 Bytes
-
https://huggingface.co/spaces/tharunk07/WeatherDetect/resolve/main/app.py
- Command line
-
hf download hf://spaces/tharunk07/WeatherDetect/app.py
-
curl -L -o app.py https://huggingface.co/spaces/tharunk07/WeatherDetect/resolve/main/app.py
711 Bytes
| import streamlit as st | |
| import weatherDetect | |
| st.title("Weather Detection") | |
| city = st.text_input("Enter the city name:") | |
| if st.button("Enter"): | |
| if city: | |
| result = weatherDetect.weather(city) | |
| if isinstance(result, tuple): | |
| current_temperature, current_humidity, weather_description = result | |
| st.write(f"**City:** {city.capitalize()}") | |
| st.write(f"**Current Temperature:** {current_temperature:.2f}°C") | |
| st.write(f"**Current Humidity:** {current_humidity}%") | |
| st.write(f"**Weather Description:** {weather_description.capitalize()}") | |
| else: | |
| st.write(result) | |
| else: | |
| st.write("Please enter a city name.") | |