[文字處理篇] 文字的編碼與解碼 - tsungjung411/python-study GitHub Wiki
- How to convert 'binary string' to normal string in Python3?
print('\x41\x42\x43') ABC print(b'\x41\x42\x43') b'ABC' print(b'\x41\x42\x43'.decode('ascii')) ABC
- What does a leading
\x
mean in a Python string\xaa
print('\x41\x42\x43') ABC print(b'\x41\x42\x43') b'ABC' print(chr(16*4+1), chr(16*4+2), chr(16*4+3)) A B C print(b'\x41\x42\x43'.decode('ascii')) ABC