ValueError: too many values to unpack

Laszlo Nagy gandalf at designaproduct.biz
Wed Apr 11 13:26:49 EDT 2007


fscked írta:
> Trying to use CSV to read in a line with 11 fields and I keep getting
> this error. I have googled a bit and have been unable to figure it out.
>
>   
Probably you have more than 11 values in some (or all) of the rows in 
the CSV file. Try this code:

L = (1,2,3,4,5)
a1,a2,a3 = L

If you are sure that you only need a certain number of values, "the 
first N columns":

a1,a2,a3 = L[:3]


Then you still can have a "not enough values to unpack" error, guess 
what that means. ;-)

   Laszlo




More information about the Python-list mailing list