Using a configspec

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 don’t think it’s included in your ConfigObj download, so you may need to download it as well. Now, let’s take a look at the code:

Get hands-on with 1200+ tech skills courses.