我认为little-endian和big-endian数字是相同的大小(以字节为单位)。但是Python 2.7的结构模块,这样说:为什么python的struct认为little-endian和big-endian意味着不同的长度?
In [46]: struct.unpack('>L', datalen[4:8])[0]
Out[46]: 35098131
In [47]: struct.unpack('L', datalen[4:8])[0]
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-47-f18e2a303d6c> in <module>()
----> 1 struct.unpack('L', datalen[4:8])[0]
error: unpack requires a string argument of length 8
为什么大端长4个字节,但结构预计小尾数长为8个字节?
尝试'struct.unpack(“
sebastian
2014-08-29 14:56:30