def to_hexstr(str_):
 return ''.join([('\\x%02x' % ord(i)) for i in bytes_iterator(str_)])

def to_hexstr ( str_ ) : return '' . join ( [ ( '\\x%02x' % ord ( i ) ) for i in bytes_iterator ( str_ ) ] )
convert a binary string to hex escape format .