Начал изучение Python, не смог найти здесь ошибку TypeError: 'str' object is not callable
from pyowm import OWM
from pyowm.utils import config
from pyowm.utils import timestamps
from pyowm.utils.config import get_default_config
config_dict = get_default_config()
config_dict['language']="ru"
import telebot
owm = OWM('токен')
mgr = owm.weather_manager()
bot = telebot.TeleBot("токен")
@bot.message_handler(content_types=['text'])
def send_echo(message):
observation = mgr.weather_at_place(message.text)
w = observation.weather
temp = w.temperature('celsius')['temp']
answer = "В городе " + message.text + " сейчас " + w.detailed_status() + "\n\n"
answer += "Температура сейчас в районе " + str(temp) + "\n\n"
if temp >= -20:
answer += "На улице очень холодно, одевай шубу!!"
elif temp < -10:
answer += "На улице прохладно, одевайся теплее!"
else:
answer += "На улице не очень холодно, одевайся как хочешь"
bot.send_message(message.chat.id, answer)
bot.polling( none_stop = True)
w.detailed_status
не функция, а строка и поэтому её вызывает не надо