Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access list of dictionaries
#3
Thank you for your swift reply.
Actually what I need most help with is finding out what the first dictionary in the list is called so I can use your formluae.
It may be that someone has deleted ford or added audi. Which is acceptable if their follow the structure. So the problem starts with getting the name of the first dictionary in the database, so ford.keys() may not work if ford is not in the list.

So can I access the first dictionary using a numerical value like [0] or ["0"]
I could possibly create a dummy car called AAAA with dummy values but correct keys, but that seems a bit self defeating.
Why make life easier for the computer when it should provide what I want??? Big Grin Big Grin Big Grin

If sqllitedict is a wrapper could I just use sqlite to find the first rows dictionary name and the using that revert to sqlitedict to retrieve the dictionary associated with it. Probably over kill, I suspect.

Thanks again, LOL
Reply


Messages In This Thread
Access list of dictionaries - by britesc - Jul-24-2023, 10:52 AM
RE: Access list of dictionaries - by deanhystad - Jul-24-2023, 02:55 PM
RE: Access list of dictionaries - by britesc - Jul-24-2023, 03:00 PM
RE: Access list of dictionaries - by deanhystad - Jul-24-2023, 07:23 PM
RE: Access list of dictionaries - by Pedroski55 - Jul-26-2023, 05:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort a list of dictionaries by the only dictionary key Calab 2 764 Apr-29-2024, 04:38 PM
Last Post: Calab
  function that returns a list of dictionaries nostradamus64 2 1,886 May-06-2021, 09:58 PM
Last Post: nostradamus64
  convert List with dictionaries to a single dictionary iamaghost 3 2,997 Jan-22-2021, 03:56 PM
Last Post: iamaghost
  Creating a list of dictionaries while iterating pythonnewbie138 6 3,437 Sep-27-2020, 08:23 PM
Last Post: pythonnewbie138
  Help accessing elements of list of dictionaries Milfredo 6 2,987 Sep-07-2020, 01:32 AM
Last Post: Milfredo
  Accessing values in list of dictionaries pythonnewbie138 2 2,231 Aug-02-2020, 05:02 PM
Last Post: pythonnewbie138
  how does .join work with list and dictionaries gr3yali3n 7 3,569 Jul-07-2020, 09:36 PM
Last Post: bowlofred
  access dictionary with keys from another and write values to list redminote4dd 6 3,411 Jun-03-2020, 05:20 PM
Last Post: DeaD_EyE
  creating a list of dictionaries from API calls AndrewEnglsh101 5 3,238 Apr-03-2020, 02:21 PM
Last Post: AndrewEnglsh101
  Access list items in Python kamaleon 2 2,467 Dec-31-2019, 11:10 AM
Last Post: kamaleon

Forum Jump:

User Panel Messages

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