Tag Archives: ConfigObj

Generating a Dialog from a File

A few days ago, I wrote an article about using ConfigObj with wxPython. The first question I was asked about the article regarded using a configuration file to generate the dialog. I thought this was an interesting idea, so I took a stab at implementing that functionality. Personally I think it would be probably be better to just create the dialog using XRC and use ConfigObj to help manage which dialog file is loaded that way. However, this was an intriguing exercise to me and I think you’ll find it enlightening too. Continue reading Generating a Dialog from a File

ConfigObj + wxPython = Geek Happiness

I recently starting using Michael Foord’s ConfigObj for one of our internal wxPython applications at work. When I wrote my other ConfigObj tutorial, I wanted to show you how I was using ConfigObj with my preferences dialog, but I didn’t want all my posts to include wx. In this article, I’ll just show you how easy it is to add a new preference setting in ConfigObj without wiping out your original ones and how to load and save them with a wxPython dialog. Now, let’s get to it! Continue reading ConfigObj + wxPython = Geek Happiness

A Brief ConfigObj Tutorial

Python comes with a handy module called ConfigParser. It’s good for creating and reading configuration files (aka INI files). However, Michael Foord (author of IronPython in Action) and Nicola Larosa decided to write their own configuration module called ConfigObj. In many ways, it is an improvement over the standard library’s module. When I first looked at ConfigObj’s home page, I thought it was well documented, but it didn’t seem to have any fully functional snippets. Since I learn from docs plus examples, I found it harder to get started using ConfigObj when the examples were unavailable. When I started writing this article, I was unaware that Michael Foord has already written his own tutorial on the subject; but I had made a promise that I would write my own, so that is what you will get to read today! Continue reading A Brief ConfigObj Tutorial