Download test.py from 22Nikk0/hugging: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/spaces/22Nikk0/hugging/resolve/main/test.py
- Command line
-
hf download hf://spaces/22Nikk0/hugging/test.py
-
curl -L -o test.py https://huggingface.co/spaces/22Nikk0/hugging/resolve/main/test.py
439 Bytes
| import requests | |
| def get_the_weather_forecast(city_name): | |
| url = 'https://wttr.in/{}'.format(city_name) | |
| try: | |
| data = requests.get(url) | |
| weather_forecast = data.text | |
| except: | |
| weather_forecast = "Error Occurred" | |
| return(weather_forecast) | |
| if __name__ == "__main__": | |
| city_name = input("Enter the name of the city: ") | |
| weather_forecast = get_the_weather_forecast(city_name) | |
| print(weather_forecast) |