Reading from a file and converting it into a list of lines

Girish Sahani girish at cse.iitb.ac.in
Tue Jun 6 02:15:58 EDT 2006


Really sorry for that indentation thing :)
I tried out the code you have given, and also the one sreeram had written.
In all of these,i get the same error of this type:
Error i get in Sreeram's code is:
n1,_,n2,_ = line.split(',')
ValueError: need more than 1 value to unpack

And error i get in your code is:
for n1, a1, n2, a2 in reader:
ValueError: need more than 0 values to unpack

Any ideas why this is happening?

Thanks a lot,
girish






More information about the Python-list mailing list