Thursday 6 May 2021

How to convert 'binary string' to normal string in Python3?

Decode it.

>>> b'a string'.decode('ascii')
'a string'

To get bytes from string, encode it.

>>> 'a string'.encode('ascii' 


from : https://stackoverflow.com/questions/17615414/how-to-convert-binary-string-to-normal-string-in-python3

No comments:

Post a Comment