Answer the question
In order to leave comments, you need to log in
Yesterday I created a Python program about the weather, today: 'Remote host forcibly terminated the existing connection'. Can you help?
Here is the code:
import pyowm
owm = pyowm.OWM('b9db63fb0615590ebd84f6e780a2ed2d', language = "ru")
observation = owm.weather_at_place('Naberezhnyye Chelny,RU')
w = observation.get_weather()
temp = w.get_temperature('celsius' )["temp"]
wind = w.get_wind()["speed"]
humidity = w.get_humidity()
print(str(" "))
print("Currently in Naberezhnye Chelny " + w.get_detailed_status() + ( "."))
print("Temperature: " + str(temp) + " °C" + ("."))
print("Wind speed: " + str(wind) + " m/s" + (". "))
print("Air humidity: " + str(humidity) + "%" + ("."))
if temp < 10:
print("It's cold outside, better wear a windbreaker:D.")
elif temp < 20:
print("It's warm outside, wear a T-shirt.")
elif temp < 30:
print("It's hot outside, come out in a T-shirt.")
elif temp > 30:
print("Ooooh, it's just Sahara outside now, no elif
temp < 0:
print("It's cold outside, dress warmly.")
elif temp < -10:
print("It's cold outside, dress warmly.")
elif temp < -20:
print("It's very cold outside, dress warmly.")
elif temp < -30:
print("It's very, very cold outside, dress very warmly.")
elif temp < -40:
print("Outside hyper cold, dress hyper warm :D.")
else:
print("Error!")
Yesterday I created a Python program about the weather (everything worked), and today: 'The remote host forcibly terminated the existing connection'. Help me please.
PS API key used openweathermap .
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question