I am working with python3 and I have a problem with the representation of an object.
It is the result of subprocess.Open().communicate()[0]
, which is a bytes-array but when I pass it to another function, python interprets it as a string, which is not.
This is the array that i have:
b'N\x00e\x00l\x00 \x00s\x00o\x00t\x00t\x00o\x00s\x00i\x00s\x00t\x00e\x00m\x00a\x00 \x00W\x00i\x00n\x00d\x00o\x00w\x00s\x00 \x00p\x00e\x00r\x00 \x00L\x00i\x00n\x00u\x00x\x00 \x00n\x00o\x00n\x00 \x00s\x00o\x00n\x00o\x00 \x00i\x00n\x00s\x00t\x00a\x00l\x00l\x00a\x00t\x00e\x00 \x00d\x00i\x00s\x00t\x00r\x00i\x00b\x00u\x00z\x00i\x00o\x00n\x00i\x00.\x00\r\x00\r\x00\n\x00L\x00e\x00 \x00d\x00i\x00s\x00t\x00r\x00i\x00b\x00u\x00z\x00i\x00o\x00n\x00i\x00 \x00p\x00o\x00s\x00s\x00o\x00n\x00o\x00 \x00e\x00s\x00s\x00e\x00r\x00e\x00 \x00i\x00n\x00s\x00t\x00a\x00l\x00l\x00a\x00t\x00e\x00 \x00v\x00i\x00s\x00i\x00t\x00a\x00n\x00d\x00o\x00 \x00M\x00i\x00c\x00r\x00o\x00s\x00o\x00f\x00t\x00 \x00S\x00t\x00o\x00r\x00e\x00:\x00\r\x00\r\x00\n\x00h\x00t\x00t\x00p\x00s\x00:\x00/\x00/\x00a\x00k\x00a\x00.\x00m\x00s\x00/\x00w\x00s\x00l\x00s\x00t\x00o\x00r\x00e\x00\r\x00\r\x00\n\x00'
Which is in ASCII encode, right?
My question is how can I encode it to see the right bytes values?
Or is there at least a way to pass it to the other function without it been recognised as a string, which is not?
Thanks!