sjdevnull at yahoo.com wrote: > d = {} > for line in [l[:-1] for l in file('test.txt', 'rU') if len(l)>1]: > k,v = line.split() > d.setdefault(k,[]).append(v) Try that with a test.txt where the last line has no newline. Peter