for line in raw_data:
if line.startswith('RelevantInfo1'):
info1 = raw_data.next().strip()
elif line.startswith('RelevantInfo2'):
info2 = raw_data.next().strip()
elif line.startswith('RelevantInfo3'):
info3 = raw_data.next().strip()
scores.setdefault(info1, {}).setdefault(info3, []).append(info2)
info1 = info2 = info3 = None
Very pretty. =) I have to say, I hadn't ever used iterators this way before, that is, calling their next method from within a for-loop. I like it. =)
Thanks for opening my mind. ;)
STeVe -- http://mail.python.org/mailman/listinfo/python-list
