недавно начал изучать python, решил написать программу, которая будет показывать текущую погоду. ошибка: Traceback (most recent call last):
line 41, in
rain_dict = mgr.weather_at_place("place").observation.rain
AttributeError: 'Observation' object has no attribute 'observation'. смотрел по документации - всё вроде правильно. версия модуля и python последняя. ошибок не нашёл. вот сам код:
from pyowm import OWM
from pyowm.utils.config import get_default_config
from pyowm.utils import config
from pyowm.utils import timestamps
from colorama import init
from colorama import Fore, Back, Style
init()
print(Fore.BLACK)
print(Back.CYAN)
place = input("(Введите город):")
config_dict = get_default_config()
config_dict['language'] = 'ru'
owm = OWM("a4cd51048d5f98eb0a91b299959a86dc", config_dict)
mgr = owm.weather_manager()
observation = mgr.weather_at_place("place")
weather = observation.weather
wind_dict_in_meters_per_sec = observation.weather.wind()
temp_dict_celsius = weather.temperature("celsius")
temp_dict_kelvin = weather.temperature()
temp_dict_fahrenheit = weather.temperature("fahrenheit")
rain_dict = mgr.weather_at_place("place").observation.rain
print(Back.MAGENTA)
print("Температура сейчас около: " + str(temp_dict_celsius["temp"]) + " C ")
print("Температура в Фаренгейтах: " + str(temp_dict_fahrenheit["temp"]) + " F ")
print("Температура в Кельвинах: " + str(temp_dict_kelvin["temp"]) + " K ")
print("Скорость ветра: " +str(wind_dict_in_meters_per_sec["speed"]) + " м/c ")
print("Выпавшие осадки за последний час: " + str(rain_dict["1h"]))
print("Выпавшие осадки за последние 3 часа: " + str(rain_dict["3h"]))
print("В городе " + place + " сейчас " + weather.detailed_status)