ValueError: too many values to unpack

K

k.retheesh

Hi,

I am very new to pyton, during my adventures journey I got the
following error message which am not able to solve, can somebody help
me. I was trying to format my output in a readable way,

Compare results in tblItem
________________________________________________________________________________
71 records found in pctrsqlstage case9125
71 records found in qa-sql2\pctr case9126
Database counts match: True
--------------------------------------------------------------------------------
71 unique records found in pctrsqlstage case9125
71 unique records found in qa-sql2\pctr case9126
56 records were different
Type, FileType,
Item,
Hash,

Path, Size, CullCd, Ext, DtCr,
DtLMd, DtLAc
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
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,CullCd,Ext,DtCr,DtLMd,DtLAc)
in infoDiffs :
ValueError: too many values to unpack

Thanks
Retheesh
 
A

alisonken1

56 records were different
Type, FileType,
Item,
Hash,

Path, Size, CullCd, Ext, DtCr,
DtLMd, DtLAc
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
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,CullCd,Ext,DtCr,DtLMd,DtLAc)
in infoDiffs :
ValueError: too many values to unpack

Thanks
Retheesh

The "too many values to unpack" indicates you don't have enough
variables in the [for (...) in infoDiffs: ] construct.

You also may want to change some of the names; although "Type"
(variable name) and "type" (python function) should be different, it's
good practice to not use names that are similar to functions.
 
K

k.retheesh

Thank you, that solved my problem.

Thanks
Retheesh
56 records were different
Type, FileType,
Item,
Hash,

Path, Size, CullCd, Ext, DtCr,
DtLMd, DtLAc
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
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,CullCd,Ext,DtCr,DtLMd,DtLAc)
in infoDiffs :
ValueError: too many values to unpack

Thanks
Retheesh

The "too many values to unpack" indicates you don't have enough
variables in the [for (...) in infoDiffs: ] construct.

You also may want to change some of the names; although "Type"
(variable name) and "type" (python function) should be different, it's
good practice to not use names that are similar to functions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top