Using ConfigParser to read a file without section name

前端 未结 7 2152
星月不相逢
星月不相逢 2020-11-27 03:36

I am using ConfigParser to read the runtime configuration of a script.

I would like to have the flexibility of not providing a section name (there are s

7条回答
  •  北海茫月
    2020-11-27 03:41

    Blueicefield's answer mentioned configobj, but the original lib only supports Python 2. It now has a Python 3+ compatible port:

    https://github.com/DiffSK/configobj

    APIs haven't changed, see it's doc.

提交回复
热议问题