|
From: Michael F. <fuz...@vo...> - 2007-09-26 21:38:28
|
Stef Mientki wrote: >> ini[section_name].keys() >> >> > aha that's what I'm looking for. > >> ConfigObj has a 'dictionary interface' - so all the methods available on >> a normal Python dictionary can be used with ConfigObj. >> >> Simple enough? >> >> > Yes that's indeed not too difficult ;-) > the reason why I've so much trouble with this, > is probably that I (almost) never use dictionaries. > Shock horror - Python is *built* on dictionaries! :-) > Still one other small question, which must be peanuts for you (and others), > how do I read a value as a normal string ? > When I've an inifile with following content: > size = (134,433) > ConfigObj gives me back a list > ['(134', '433)'] > By default ConfigObj treats comma separated values as lists. This *can* be inconvenient, so you can switch it off. ini = ConfigObj(filename, list_values=False) HTH Michael Foord http://www.manning.com/foord > Undoubtedly usefull in most cases (although the brackets look weird to > me ;-), > but as I move around and manipulate these "things" all over in my program, > I just want to handle 1 type, for which I've chosen the string type. > > cheers, > Stef > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |