Python - encoding/decoding Windows vs Linux -
having line of code:
print "s\x00a\x00v\x00a"
produces different output. on windows:
s v
and on linux:
sava
what difference between the 2 platform , can remove whitespaces windows case?
the difference @ terminal level.
windows cmd
prints zero-char empty whereas linux terminal doesn't print it.
note in pyscripter console or pycrust console (wx-based) s
(probably because 0 seen line-termination char). it's not portable :)
to rid of perform replace
:
print("s\x00a\x00v\x00a".replace("\x00",""))
Comments
Post a Comment