python toHex function
摘要:
hex = lambda s: ''.join(map(lambda c: "%02X" % ord(c), s)) 这是一个lambda的嵌套,我们可以分解成以下代码,就比较好理解了:def char2Hex(c): return '%02X' % ord(c)def toHexList(s): return map(char2Hex, s)def toHex(s): return ''.join(toHexList(s)) 阅读全文
posted @ 2012-09-13 13:40
盐味
阅读(326)
评论(0)
推荐(0)
浙公网安备 33010602011771号