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