scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
404 stars 68 forks source link

More interpretations in pretty printing. #238

Closed scott-griffiths closed 1 year ago

scott-griffiths commented 1 year ago

Would these make sense as additions to #231 ?

a.pp('b,h')  # binary then hex, but using the shorter notation from #237 
a.pp('u8')  # convert each 8 bits to unsigned ints and display one int per group
a.pp('hex:32, float')  # 4 bytes of hex in each group in first column, float32 in second column
a.pp('b7, i')  # 7 bits of binary in each group in first column, signed int for each group in second column 
scott-griffiths commented 1 year ago

Needs to be considered before 4.0 as we might want to remove the bits_per_group option.