binary representation of an integer

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Jun 24 08:53:28 EDT 2008


eliben:
> 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:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/111286
> However, it is very general and thus inefficient.

Try mine, it may be fast enough for your purposes:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440528

Bye,
bearophile



More information about the Python-list mailing list