binary representation of an integer

bearophileHUGS at bearophileHUGS at
Tue Jun 24 14:53:28 CEST 2008

> Python's pack/unpack don't have the binary format for some reason, so
> custom solutions have to be developed. One suggested in the ASPN
> cookbook is:
> However, it is very general and thus inefficient.

Try mine, it may be fast enough for your purposes:


More information about the Python-list mailing list