On Wed, 02 Feb 2005 02:35:03 -0800, python wrote: > Each pair in a dictionary is separated by CRLF and in each dictionary > numbers of pairs can be different. > I need to read only the the first and the last dictionaries.What is a > best solution? > Thanks > Lad
Who cares about the best solution? Odds are, your process is disk-bound anyhow. Is this a thinly-veiled attempt to get someone to provide you *a* solution, or do you already have one and you are seriously asking for a better one? Because I'd say, take the easiest programming route: Parse the first dict into a variable, then just loop until you run out of file, storing a parsed dict in the "last" variable and just naturally letting later ones overwrite earlier ones. If you want something "best"-er than that (heh heh), you're going to have to tell us how you are measuring better-ness. -- http://mail.python.org/mailman/listinfo/python-list