Answer the question
In order to leave comments, you need to log in
How to solve PyOWM 3.2.0 output issue?
Now there is a small problem:
Traceback (most recent call last):
File "C:\Python\My Own Projects\hernuia\test_var1.py", line 12, in
print("In the city " + observation + " now " + w. get_detailed_status())
TypeError: can only concatenate str (not "Observation") to str
PS Code:
import pyowm
owm = pyowm.OWM("a69f2b4e45869e5efa459f47b2389c69") # <- API Key
mgr = owm.weather_manager()
observation = mgr.weather_at_place ('London,GB')
w = observation.weather
observation.weather
observation.weather.temperature('celsius')['temp']
print("In the city " + observation + " now " + w.get_detailed_status())
print("Temperature >> " + str(temp))
Answer the question
In order to leave comments, you need to log in
The observation variable contains an instance of the Observation class and cannot be added to the string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question