Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个在python中将“\x61\x62\x63\x64\x65\x66”转换为“abcdef”的函数,而无需打印它
并且是这种编码ascii hex的正确术语吗?
>>> "\x61\x62\x63\x64\x65\x66".decode('ascii') u'abcdef'
您可以使用以下方法将 "\x61\x62\x63\x64\x65\x66" 转换为 unicode 字符串unicode:
unicode
unicode("\x61\x62\x63\x64\x65\x66")
输出:u'abcdef'