Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Tim Michelsen
>>> But to my optinion Config Parser offers the following advantage: >>> - Readable >>> - All are strings => no strange 'mysetting' is needed. >> I'm not sure what you mean. The Python variables and dictionary >> is all strings too. mysetting is just a string... > > He means, with ConfigParser st

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >> I'm not sure what you mean. The Python variables and dictionary >> is all strings too. mysetting is just a string... > > He means, with ConfigParser strings don't need to be quoted, giving > perhaps a cleaner and more friendly syntax. Ah, I see, yes th

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Kent Johnson
Alan Gauld wrote: >> But to my optinion Config Parser offers the following advantage: >> - Readable >> - All are strings => no strange 'mysetting' is needed. > > I'm not sure what you mean. The Python variables and dictionary > is all strings too. mysetting is just a string... He means, with Co

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Alan Gauld
"Tim Michelsen" <[EMAIL PROTECTED]> wrote >> import myconfig >> foo2 = myconfig.SectionFoo['second'] > This seems like reinventing what the ConfigParser > mdoule [1] already does. But with the advantage that its pure python, no parsing needed so its both faster and avouds any string to int typ

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Tim Michelsen
>>> Another option is to have the config settiongs in a normal >>> Python module and just import it. > >> I think that the cfg-files are much more readable for others. > > More readable than: > > # Section Heading > variable = value > > It looks pretty easy to read to me! :-) > > If its very

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-15 Thread Alan Gauld
"Tim Michelsen" <[EMAIL PROTECTED]> wrote in >> Another option is to have the config settiongs in a normal >> Python module and just import it. > I think that the cfg-files are much more readable for others. More readable than: # Section Heading variable = value It looks pretty easy to read

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-14 Thread Tim Michelsen
> Yes, thats the way I'd recommend. >> Is there a more decent and elegant way? I don't know. I was just asking how other programmers achive this efficiently. > Another option is to have the config settiongs in a normal > Python module and just import it. That is less appealing if > the config fi

Re: [Tutor] setting program configuration for all files and modules ofa program

2008-04-14 Thread Alan Gauld
"Tim Michelsen" <[EMAIL PROTECTED]> wrote > But I would like to modularize my code and separate the GUI code > from > the functional code that provides the calculation operations. This > will > help to expand the functionality at a later stage. I want to achieve > this through splitting the code