Mar-02-2018, 11:54 AM
To convert byte strings into string use the
decode()
method (assuming the byte strings represent unicode strings encoded in some encoding)>>> bx = b'p107\xff\xff\xff' >>> sx = bx.decode('latin-1') >>> sx 'p107ÿÿÿ'