csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
791 stars 175 forks source link

'Location' object has no attribute 'get_id' #132

Closed ghost closed 8 years ago

ghost commented 8 years ago

For:

location = "Hampshire,uk"
obs = owm.weather_at_place(location)
l = obs.get_location()
name = l.get_name()
print(name)
regID = l.get_id()
print(regID)

I get:

Hampshire

Traceback (most recent call last):
  File "owtest.py", line 39, in <module>
    regID = l.get_id()
AttributeError: 'Location' object has no attribute 'get_id'

Using PyOWM 2.4.0 on current version of Python (3.5 at time of writing) Apart from that (, it works fine, it just means I can't retrieve the ID.

csparpa commented 8 years ago

@lardconcepts I think it's your mistake here I've tested your exact code, please notice the uppercase in the very last call:

regID = l.get_ID()
2647554
ghost commented 8 years ago

Oh, silly me. Should'a copied and pasted. Thanks and sorry,

csparpa commented 8 years ago

No problems man ;) glad you like the library!