struct.pack and perl's 'B' code for bitstrings
Justin Johnson
justinjohnson at fastmail.fm
Fri Jun 27 16:19:35 EDT 2003
Is there anything equivalent to perl's pack code B, which allows you to
specify bits to pack? For example, in perl, pack('B8', '00000010') will
return 8 bits exactly as the bit string appears. I don't see any similar
codes in struct.pack. In general struct.pack is not as robust as perl's
pack function. Is there a better version of struct somewhere, or how are
people overcoming some of these problems?
Thanks much.
-Justin
More information about the Python-list
mailing list