Re: Config files with different types

2009-07-03 Thread Zach Hobesh
yaml looks pretty interesting. Also, I wouldn't have to change much, I would still use the same function, and still output a dict. Thanks! -Zach On Thu, Jul 2, 2009 at 11:55 PM, Javier Collado wrote: > Hello, > > Have you considered using something that is already developed? > > You could take

Re: Config files with different types

2009-07-03 Thread Javier Collado
Hello, Have you considered using something that is already developed? You could take a look at this presentation for an overview of what's available: http://us.pycon.org/2009/conference/schedule/event/5/ Anyway, let me explain that, since I "discovered" it, my favourite format for configuration

Re: Config files with different types

2009-07-02 Thread Lawrence D'Oliveiro
In message , Zach Hobesh wrote: > I want to be able to look at the value and determine what type it > SHOULD be. Right now, configs['overwrite'] = 'true' (a string) when > it might be more useful as a boolean. Typically the type should be what you expect, not what is given. For example, it doe

Re: Config files with different types

2009-07-02 Thread MRAB
Zach Hobesh wrote: Hi all, I've written a function that reads a specifically formatted text file and spits out a dictionary. Here's an example: config.txt: Destination = C:/Destination Overwrite = True Here's my function that takes 1 argument (text file) the_file = open(textfile,'r') linel

Config files with different types

2009-07-02 Thread Zach Hobesh
Hi all, I've written a function that reads a specifically formatted text file and spits out a dictionary.  Here's an example: config.txt: Destination = C:/Destination Overwrite = True Here's my function that takes 1 argument (text file) the_file = open(textfile,'r') linelist = the_file.read()