470,613 Members | 2,194 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

Unpacking a list of strings

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])?

Apr 27 '06 #1
1 1253
Panos Laganakos <pa*************@gmail.com> wrote:
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])?


unpack by formatstring 10*'17s' ...
Alex
Apr 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

32 posts views Thread by Dave Benjamin | last post: by
2 posts views Thread by george young | last post: by
8 posts views Thread by Paul McGuire | last post: by
5 posts views Thread by Chris | last post: by
9 posts views Thread by tkpmep | last post: by
4 posts views Thread by McA | last post: by
21 posts views Thread by Martin Geisler | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.