> On 6 Dec 2023, at 09:32, Chris Green via Python-list <python-list@python.org> > wrote: > > My requirement is *slightly* more complex than just key value pairs, > it has one level of hierarchy, e.g.:- > > KEY1: > a: v1 > c: v3 > d: v4 > KEY2: > a: v7 > b: v5 > d: v6 > > Different numbers of value pairs under each KEY. JSON will allow you to nest dictionaries. { 'KEY1': { 'a': v1 'c': v3 'd': v4 } 'KEY2': { 'a': v7 'b': v5 'd': v6 } } Personally I would not use .ini style these days as the format does not include type of the data. Also I would not use the ast.literal_eval as it makes debugging errors in the data harder. Barry -- https://mail.python.org/mailman/listinfo/python-list
- How/where to store calibration values - wri... Chris Green via Python-list
- Re: How/where to store calibration val... MRAB via Python-list
- Re: How/where to store calibration... Thomas Passin via Python-list
- Re: How/where to store calibra... Chris Green via Python-list
- Re: How/where to store cal... Dan Sommers via Python-list
- Re: How/where to store cal... Barry Scott via Python-list
- Re: How/where to stor... Thomas Passin via Python-list
- Re: How/where to ... MRAB via Python-list
- Re: How/where... dn via Python-list
- Re: How/where... MRAB via Python-list
- A problem wit... Steve GS via Python-list
- RE: A problem... AVI GROSS via Python-list
- Re: A problem... Thomas Passin via Python-list
- Re: A problem... dn via Python-list
- RE: A problem... Steve GS via Python-list
- Re: A problem... Roel Schroeven via Python-list