Bitstream -- Binary Data for Humans (Posting On Python-List Prohibited)

Terry Reedy tjreedy at udel.edu
Tue Mar 6 05:14:41 EST 2018


On 3/6/2018 3:58 AM, Sébastien Boisgérault wrote:
> Hi Lawrence,
> 
> Le mardi 6 mars 2018 01:20:36 UTC+1, Lawrence D’Oliveiro a écrit :
>> On Tuesday, March 6, 2018 at 8:06:00 AM UTC+13, Sébastien Boisgérault wrote:
>>> I have released bitstream, a Python library to manage binary data
>>> (at the byte or bit level), hopefully without the pain that this kind
>>> of thing usually entails :)
>>
>>>     byte_index = offset / 8
>>
>> This will return a float.

byte_index // 8
will give you the int index directly in both late 2.x and 3.x.

-- 
Terry Jan Redey





More information about the Python-list mailing list