Answer the question
In order to leave comments, you need to log in
How to link pyowm and telebot?
Hello, I just started learning Python.
I have a specific code that outputs the weather through the API, it has a place variable.
How to make the user text he sends pyowm code see as a variable tried like this:
if message.chat.type == 'private':
if message.text == "Москва" :
owm = OWM('MyAPI')
mgr = owm.weather_manager()
place = input(message.text)
observation = mgr.weather_at_place(place)
bot.send_message(message.chat.id,"В городе "+place+" сейчас температура: " + str(kelvin_to_celsius(w.temp['temp'])) + " по Цельсию. ")
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