Python Forum
Error loading location on openweathermap via API with Kivy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error loading location on openweathermap via API with Kivy
#7
Ok, but how do I get 'Vancouver, US' and Vancouver, CA' as expected?
I changed the line cities = ["{} ({})".format(d['name'], d['sys']['country']) for d in data['list']] to cities = ["{} ({})".format(d['name'], d['sys']['country']) for d in list['data']] thinking that perhaps it was a typo in the book. The result was:

cities = ["{} ({})".format(d['name'], d['sys']['country']) for d in list['data']]

TypeError: 'type' object is not subscriptable
Reply


Messages In This Thread
RE: Error loading location on openweathermap via API with Kivy - by Gigux - Apr-19-2019, 08:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error when running kivy on python janeik 8 2,199 Jun-16-2023, 10:58 PM
Last Post: janeik
  Error loading Trelby.py blackclover 3 2,567 Jan-05-2021, 10:08 PM
Last Post: blackclover
  import error (unknown location) pseudo 1 10,838 Nov-14-2019, 11:47 PM
Last Post: pseudo
  kivy - packaging touchtracer syntax error cram 2 2,596 Oct-14-2019, 08:30 PM
Last Post: cram
  Getting error while loading excel(.xlsx) file using openpyxl module shubhamjainj 1 9,064 Mar-01-2019, 01:05 PM
Last Post: buran
  error creating new object after loading pickled objects from file arogers 2 3,505 Feb-02-2019, 10:43 AM
Last Post: Larz60+
  PyQt5 No Error But GUI Window Not Loading digitalmatic7 1 4,314 Nov-21-2017, 05:23 PM
Last Post: digitalmatic7
  Error while loading the csv file Analyst 3 10,297 Oct-18-2017, 07:07 AM
Last Post: Analyst
  'NoneType' object has no attribute error, when using Kivy Screens chelovek 3 11,173 Feb-05-2017, 05:37 AM
Last Post: chelovek

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020