Which is the best way to allow configuration options be overridden at the command line in Python?

后端 未结 8 1887
南笙
南笙 2020-12-22 15:13

I have a Python application which needs quite a few (~30) configuration parameters. Up to now, I used the OptionParser class to define default values in the app itself, with

8条回答
  •  清酒与你
    2020-12-22 16:07

    Check out ConfigArgParse - its a new PyPI package (open source) that serves as a drop in replacement for argparse with added support for config files and environment variables.

提交回复
热议问题