How to convert bytes string to bytes
Advertisements I have a string from a database request as follows: result = "b’\x00\x00\x00\x00\x07\x80\x00\x03’" type(result) -> <class ‘str’> How do I convert it to bytes? It should be like this: a = b’\x00\x00\x00\x00\x07\x80\x00\x03′ type(a) -> <class ‘bytes’> >Solution : From what I understood (I have a terrible understanding of english): You can use the eval()… Read More How to convert bytes string to bytes