我想在 \xNN 中打印出十六进制字符串。有什么快速的方法可以让 \xNN 转换回十六进制字符串吗?我更喜欢本机快速方法而不是手动编写长函数。
例如。
$ python
>>> '\x74op'
>>> 'top'
>>> s=r'\x74op'
>>> '\\x74op'
>>> convert(s) # how to write this function
>>> 'top'
我想在 \xNN 中打印出十六进制字符串。有什么快速的方法可以让 \xNN 转换回十六进制字符串吗?我更喜欢本机快速方法而不是手动编写长函数。
例如。
$ python
>>> '\x74op'
>>> 'top'
>>> s=r'\x74op'
>>> '\\x74op'
>>> convert(s) # how to write this function
>>> 'top'