owm = pyowm.OWM('ключ из openweaher', language = "RU") # тут пробовал и ru, все равно английский
observation = owm.weather_at_place(city)
w = observation.get_weather()
temperature = w.get_temperature('celsius')['temp']
translator= Translator(from_lang="english",to_lang="russian")
self.write_msg(id, "В городе " + city.title() + " " + str(math.ceil(temperature)) + "°. " + "Вижу: " + translator.translate(w.get_status()))
from pyowm import OWM
from pyowm.utils.config import get_default_config
place = input(" Введите город/страну: ")
config_dict = get_default_config()
config_dict['language'] = 'ru'
owm = OWM( 'API-Key', config_dict )
mgr = owm.weather_manager()
observation = mgr.weather_at_place(place)
w = observation.weather
print(w)
import pyowm
from pyowm.commons.enums import SubscriptionTypeEnum
from pyowm.utils.measurables import kelvin_to_celsius
city = 'Moscow'
config = {
'subscription_type': SubscriptionTypeEnum.FREE,
'language': 'ru',
'connection': {
'use_ssl': True,
'verify_ssl_certs': True,
'use_proxy': False,
'timeout_secs': 5
},
'proxies': {
'http': 'http://user:pass@host:port',
'https': 'socks5://user:pass@host:port'
}
}
owm = pyowm.OWM('', config=config)
mgr = owm.weather_manager()
observation = mgr.weather_at_place(city)
w = observation.weather
print("В городе " + city + " сейчас температура: " + str(kelvin_to_celsius(w.temp['temp'])) + " по Цельсию.")
print('Погода в указанном городе: ' + observation.location.name)