How to create a dict based on such a file?

Dan Stromberg drsalists at gmail.com
Tue Feb 15 01:43:50 CET 2011


On Mon, Feb 14, 2011 at 3:06 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Mon, 14 Feb 2011 11:25:00 -0800, Dan Stromberg wrote:
>
>> FWIW, the creator of the many .ini format(s), Microsoft, no longer
>> recommends using .ini files.
>
> That's because they want people to use the registry.
>
> INI files are simple, easy to parse, lightweight, and human readable and
> human writable using nothing more than a text editor. For many purposes,
> they are perfectly fine. As I see it, the biggest problems with INI files
> are:
>
> * the INI file module that comes with Python is quite primitive;
>
> * there are many slightly different behaviours you might want in an INI
> file, and no clean or obvious way to tell which one you are dealing with
> just from the file.

More to the point, there are many dialects of ini files, and nothing
more than a defacto standard for how they should work.

They also stand out like a sore thumb on anything but Windows, and
look a bit anachronistic on Windows.

But I don't hate ini files - I just think they aren't that clearly a
great choice.  If you want to use them, fine.  If you recommend them,
fine.



More information about the Python-list mailing list