Perl -> Python unpack

James Mills prologic at
Sat Aug 7 08:43:39 CEST 2010

On Sat, Aug 7, 2010 at 4:30 AM, James Mills
<prologic at> wrote:
> What does a* or A* translate to in Python when unpacking
> binary data with struct.unpack(...) ?

Fine I"ll answer my own question.

Python _does not_ support implicit size
in struct formatting rules. sizes are explicit
meaning that you must "compute" the size
you require.

a* or A* would translate to 10s for example
where you want a string with a size of 10.


-- James Mills
-- "Problems are solved by method"

More information about the Python-list mailing list