Unpacking a list of strings

Panos Laganakos panos.laganakos at gmail.com
Thu Apr 27 08:56:06 EDT 2006


Is there some other practice than reading all the strings and slicing
them later?

They're stored in the form of:
List Group[10]:
    char[17] name;

So I thought of doing:
unpacked = unpack('%s' % (10*17), data)

And then slicing the list by a step of 17.

Is there some way to have unpack return a tuple with each element
holding the name (char[17])?




More information about the Python-list mailing list