Python's ConfigParser unique keys per section

前端 未结 2 587
花落未央
花落未央 2020-12-09 20:36

I read the part of the docs and saw that the ConfigParser returns a list of key/value pairs for the options within a section. I figured that keys did not need t

2条回答
  •  长情又很酷
    2020-12-09 21:03

    This deficiency of ConfigParser is the reason why pyglet used patched version of epydoc to replace ConfigParser ini with this simple format:

    name: pyglet
    url: http://www.pyglet.org/
    
    output: html
    target: doc/api/
    ...    
    module: pyglet
    
    exclude: pyglet.gl.gl
    exclude: pyglet.gl.agl
    exclude: pyglet.gl.lib_agl
    exclude: pyglet.gl.wgl
    ...
    

    If you don't need sections - this approach can be useful.

提交回复
热议问题