def str_to_hex(string):
 return ':'.join((x.encode('hex') for x in string))

def str_to_hex ( string ) : return ':' . join ( ( x . encode ( 'hex' ) for x in string ) )
returns a string in readable hex encoding .