python single configuration file

前端 未结 4 599
旧巷少年郎
旧巷少年郎 2021-01-31 18:50

I am developing a project that requires a single configuration file whose data is used by multiple modules.
My question is: what is the common approach to that? should i rea

4条回答
  •  日久生厌
    2021-01-31 19:32

    One nice approach is to parse the config file(s) into a Python object when the application starts and pass this object around to all classes and modules requiring access to the configuration.

    This may save a lot of time parsing the config.

提交回复
热议问题