[Tutor] Writing a Configuration Facility for an Application

A.T.Hofkamp a.t.hofkamp at tue.nl
Fri Jan 30 13:47:57 CET 2009

Wayne Watson wrote:
> mask file: c:\operation/horizon.jpg
> latitutde: -140.22
> longitude 38.22
> start time: 18:25:00
> stop time: 06:30:00
> event directory: d:\events_2009
> grey scale: yes
> autoexpose format: gif

> I suspect there may be a standard way of doing this in Python that relies on 
> more complex operations that simplify matters than just reading the file one 
> line at a time. Dictionaries?  Comments?

The ConfigParser module in the standard library can do this for you.
(Which is written in pure Python BTW in case you want to find out how they do it.)


More information about the Tutor mailing list