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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -