def str_to_hex(s): return ' '.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): ) for b in s.split(' ')]]) def str_to_bin(s): return ' '.join([bin(ord(c)).replace('0b', '') for c in s]) def bin_to_str(s): ) for b in s.split(' ')]])…
def str_to_hex(s): return r"/x"+r'/x'.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): ) :]]]) def str_to_bin(s): return ' '.join([bin(ord(c)).replace('0b', '') for c in s]) def bin_to_str(s): ) for b in s.split(' ')]]) a=&quo…
转自http://hi.baidu.com/qwpsmile/blog/item/9bc44efa4f41018a9f514637.html +----------------+| strtol |+----------------+ i.e. string to long long int strtol(const char *nptr, char **endptr, int base)strtol()会将nptr指向的字符串,根据参数base,按权转化为lo…