0
我有以下代碼:不兼容性在Python 3個功能(quote_from_bytes和unquote_to_bytes)結果
src = b'\x12\x34\x56\x78\x9a\xbc\xde\xf1\x23\x45\x67\x89\xab\xcd\xef\x12\x34\x56\x78\x9a'
quoted = quote_from_bytes(src)
print(quoted)
unquoted = unquote_to_bytes(quoted)
print(unquoted)
我不明白,爲什麼print(unquoted)
回報 b'\x124Vx\x9a\xbc\xde\xf1#Eg\x89\xab\xcd\xef\x124Vx\x9a'
代替b'\x12\x34\x56\x78\x9a\xbc\xde\xf1\x23\x45\x67\x89\xab\xcd\xef\x12\x34\x56\x78\x9a'
src爲一個sha1哈希。
我使用Python 3.3版本
非常感謝你。這很明顯。我需要一個娛樂=) 我想知道爲什麼不相反 – kden 2013-02-15 14:04:47