[Tutor] config file parsing problem.

Cliff Wells logiplex at qwest.net
Thu Sep 4 16:43:10 EDT 2003


On Wed, 2003-09-03 at 03:54, Thomi Richards wrote:
> Hi guys,
> 
> 
> What's the best way to read / write a config file? More specifically:
> 
> I have a config file with a series of name = value pairs. This file also has 
> comments (line which *start* with a "#" or a ";") amongst the actual data 
> lines. At the moment, I am just opening the file, reading it line by line, 
> and either ignoring it, or exec()ing the line (I know this isn't very safe, 
> but for now it's OK).

Why not just use the ConfigParser module?

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726  (800) 735-0555




More information about the Tutor mailing list