[EMAIL PROTECTED] 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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to