python 字符串逐个转16进制

转载

原文地址:

s="aasdajoijlsknhv"
s_hex=""
for i in range(len(s)):
    s_hex=s_hex+hex(ord(s[i]))[2:]+" "
print(s_hex)

输出:61 61 73 64 61 6a 6f 69 6a 6c 73 6b 6e 68 76 

posted @ 2020-01-02 15:23  远洪  阅读(537)  评论(0编辑  收藏  举报