CONTEST - What is the (best) solution?

Fuzzyman fuzzyman at gmail.com
Wed Feb 2 08:29:43 EST 2005


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,


Fuzzy
http://www.voidspace.org.uk/python/index.shtml




More information about the Python-list mailing list