python 3.x - Python3 string representation -
in python2 1 could:
>>> struct.pack(">f", 125.4) >>> 'b\xfa\xcc\xcd'
how can same string in python3? i've tried different encodings, can exactly.
i able correct string decoding bytes 'latin1' codec. doesn't same in python3 console in python2 console, interpreted same program.
python2:
>>> struct.pack(">f", 125.4) 'b\xfa\xcc\xcd'
python3:
>>> b = struct.pack(">f", 125.4) >>> b.decode("latin1") <something cannot pasted>
Comments
Post a Comment