CONTEST - What is the (best) solution?

python at hope.cz python at hope.cz
Wed Feb 2 10:12:31 EST 2005


Fuzzyman wrote:
> Can your dictionaries contain dictionaries ?
>
> If not you can read the file and cut at the first '}' and the last
'{'.
> The two chunks will then be a single dictionary which can be eval'd.
>
> *However* your example above does not show ',' between all of the
> pairs... but only some. This will bugger you royally (because you
can't
> even replace '\n' with ','). You'd then need to parse the two chunks
> and correct.....
> Regards,
>
>
Hi Fuzzy,
dictionaries can NOT contain dictionaries.
I re-checked and I would need only the last dictionary.
Any idea how I could do that?
Thanks
Lad.




More information about the Python-list mailing list