Conversion of perl unpack code to python - something odd
fredrik at pythonware.com
Thu May 18 15:50:53 CEST 2006
Andrew Robert wrote:
> # From the language declarations in manual, the following format was derived
> format='4s 4s 48s 48s 64s 4s 256s 128s 128s 48s'
that's 10 specifiers.
that's two variables.
> print d1
> When I run it, it says there are too many values to unpack.
> Traceback ( most recent call last)
> File "m:\mq\mq\scripts\format.py", line 32, in ?
> d1, d2 = struct.unpack(format,data)
> ValueError: too many values to unpack
> Error starting triggered application
> I checked the manual on the structure used to pack the code and it
> appears correct.
try printing the return value from struct.unpack, and see if you can
figure out what's wrong with your code:
More information about the Python-list