python 以十六进制输出字符串

def mem(arr):
    r = ""
    for i in range(len(arr)):
       r += (ord(arr[i])).__hex__() + " "
       if (i%16) == 0:
            r += ""
    print r

你可能感兴趣的:(Python)