相关疑难解决方法(0)

packing and unpacking variable length array/string using the struct module in python

I am trying to get a grip around the packing and unpacking of binary data in Python 3. Its actually not that hard to understand, except one problem:

what if I have a variable length textstring and want to pack and unpack this in the most elegant manner?

As far as I can tell from the manual I can only unpack fixed size strings directly? In that case, are there any elegant way of getting around this limitation without padding …

python binary struct python-3.x

30
推荐指数
4
解决办法
7万
查看次数

标签 统计

binary ×1

python ×1

python-3.x ×1

struct ×1