Using a configspec
Explore how to use ConfigObj and configspec to create and validate Python configuration files. Understand setting types, default values, and constraints using the validate module.
We'll cover the following...
We'll cover the following...
ConfigObj also provides a way to validate your configuration files using a configspec. When I mentioned that I was going to write on this topic, Steven Sproat (creator of Whyteboard) volunteered his configspec code as an example. I took his specification and used it to create a default config file. In this example, we use Foord’s validate module to do the validation. I ...