Scott David Daniels wrote: > Peter Otten wrote:
>> with open(filename) as instream: >> lines = (line.strip() for line in lines) >> lookup = dict(zip(lines, lines)) > Little bit of a fluff-up here. Sorry, it should have been with open(filename) as instream: lines = (line.strip() for line in instream) lookup = dict(zip(lines, lines)) > Perhaps something like: > > with open(filename) as instream: > lines = (line.strip() for line in instream) > lookup = dict(zip(lines[::2], lines[1::2])) Tu quoque ;) Peter -- http://mail.python.org/mailman/listinfo/python-list