Skip to content Skip to sidebar Skip to footer

Byte To Character Transformation In Python

Using the following code I was able to convert characters to bits: msg= bitarray(endian='little') msg.frombytes(b'ABCDEFGH') How to convert it back bits to characters? NOTE: This

Solution 1:

A bitarray object has a tobytes() method as well:

bytes_value = msg.tobytes()

Post a Comment for "Byte To Character Transformation In Python"