· 6 years ago · Mar 12, 2020, 03:35 PM
1import pyowm
2
3owm = pyowm.OWM('your API key')
4
5ne = owm.weather_at_place('city, country')
6 neg = owm.three_hours_forecast('city, country)
7 weather = ne.get_weather()
8 temperature = weather.get_temperature('celsius') ['temp']
9 rain = neg.will_have_rain()
10 print(f"Temperature: {temperature}C")
11 print(f"Will It rain: {rain}")