ValueError: too many values to unpack

2006-06-08 Thread k . retheesh
ype,Item,Hash,Path,Size,CullCd,Ext,DtCr,DtLMd,DtLAc) in infoDiffs : ValueError: too many values to unpack Thanks Retheesh -- http://mail.python.org/mailman/listinfo/python-list

ValueError: too many values to unpack

2007-04-11 Thread fscked
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: too many values to unpack

2006-06-08 Thread alisonken1
> File "Q:\PythonScripts\InventoryCompareCase.py", line 117, in main > for (Type,FileType,Item,Hash,Path,Size,CullCd,Ext,DtCr,DtLMd,DtLAc) > in infoDiffs : > ValueError: too many values to unpack > > Thanks > Retheesh The "too many values to unpack" in

Re: ValueError: too many values to unpack

2006-06-08 Thread k . retheesh
unScript > > exec codeObject in __main__.__dict__ > > File "Q:\PythonScripts\InventoryCompareCase.py", line 234, in ? > > main() > > File "Q:\PythonScripts\InventoryCompareCase.py", line 117, in main > > for (Type,FileType,Item,Hash,Path,Size,Cul

Re: ValueError: too many values to unpack

2007-04-11 Thread [EMAIL PROTECTED]
That happens when you try something like this: a,b,c = [1,2,3,4] It means there are more items on the right side than the left. You probably have < 11 variables on the left side. On Apr 11, 10:13 am, "fscked" <[EMAIL PROTECTED]> wrote: > Trying to use CSV to read in a line with 11 fields and I

Re: ValueError: too many values to unpack

2007-04-11 Thread Laszlo Nagy
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

Re: ValueError: too many values to unpack

2007-04-11 Thread fscked
On Apr 11, 10:26 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > 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

Re: ValueError: too many values to unpack

2007-04-11 Thread Laszlo Nagy
> Hmm, well I have counted the fields in the CSV and verified there are > only 11. Here is the offending code: > > Try this instead: lineno = 0 for values in csvreader: try: lineno += 1 boxid, mac, activated, hw_ver, sw_ver, heartbeat, name, address,phone, country, ci

Re: ValueError: too many values to unpack

2007-04-11 Thread Gabriel Genellina
En Wed, 11 Apr 2007 16:28:08 -0300, fscked <[EMAIL PROTECTED]> escribió: >> 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 > > myfile = open('ClientsXMLUpdate.csv') > csvreader = csv.reader(myfile) > > f

Re: ValueError: too many values to unpack

2007-04-11 Thread John Machin
On Apr 12, 5:28 am, "fscked" <[EMAIL PROTECTED]> wrote: > On Apr 11, 10:26 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > > > > 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. > >

Re: ValueError: too many values to unpack

2007-04-11 Thread fscked
You guys have given me some great ideas, I am going to try them all out and let you guys know how it turns out. On a side note, thanks for nto bashing a noob like me who isn't the greatest pythonista around. I am trying to learn and you guys are how I learn my mistakes. Well you, and the fact the

Re: ValueError: too many values to unpack

2007-04-11 Thread Bruno Desthuilliers
Laszlo Nagy a écrit : (snip) > Try this instead: > > lineno = 0 > for values in csvreader: >try: > lineno += 1 Laszlo, may I suggest using enumerate() here instead ?-) for lineno, row in enumerate(csvreader): print "line %s" % lineno+1 # want 1-based numbering -- http://mail.python