Dar*_*nce 4 python struct python-3.x
我在Python 3.4中使用struct模块,如下所示:
length = struct.unpack('>B', data[34])[0]
Run Code Online (Sandbox Code Playgroud)
data 看起来像这样:
b'\x03\x01\x0e}GZ\xa8\x8e!\x1c\x7ft\xe8\xf9G\xbf\xb1\xdf\xbek\x8d\xb3\x05e~]N\x97\xad\xcaz\x03tP\x00\x00\x1eV\x00\xc0\n\xc0\t\xc0\x13\xc0\x14\xc0\x07\xc0\x11\x003\x002\x009\x00/\x005\x00\n\x00\x05\x00\x04\x01\x00\x00f\x00\x00\x00\x1b\x00\x19\x00\x00\x16parteek.khalsabani.com\xff\x01\x00\x01\x00\x00\n\x00\x08\x00\x06\x00\x17\x00\x18\x00\x19\x00\x0b\x00\x02\x01\x00\x00#\x00\x003t\x00\x00\x00\x10\x00\x1b\x00\x19\x08spdy/3.1\x06spdy/3\x08http/1.1\x00\x05\x00\x05\x01\x00\x00\x00\x00'
Run Code Online (Sandbox Code Playgroud)
我正进入(状态
TypeError:'int'不支持缓冲区接口.
我是使用struct的新手.怎么了?
| 归档时间: |
|
| 查看次数: |
4249 次 |
| 最近记录: |