Binary file Pt 1 - Only reading some

Mastastealth mastastealth at
Tue Feb 5 16:48:50 CET 2008

On Feb 5, 8:50 am, Mastastealth <mastastea... at> wrote:
> What is this value for? "6s3s1cBBBh" and why is my unpack limited to a
> length of "16"?
> Unfortunately it seems my understanding of binary is way too basic for
> what I'm dealing with. Can you point me to a simple guide to
> explaining most of it? As far as I know this is just a bunch of 1's
> and 0's right? Each byte has 8 digits of, of which somehow is
> converted to a number or letter. Don't know what most of that stuff in
> the struct page means. -_-

Ah never mind, after closer inspection is was something on my side of
the code that ruined the tuple unpacking. Also, I now understand (a
little) what the string meant.

6s = A string of 6 characters
3s = String with 3 characters
1c = For the blank character
B's = An unsigned char, any number I guess?
h = short integer. Whatever that is.

Either way, just answering myself so you don't have to explain it. :D

More information about the Python-list mailing list