def make_esc(esc_chars):
 return (lambda s: u''.join([((u'\\' + c) if (c in esc_chars) else c) for c in s]))

def make_esc ( esc_chars ) : return ( lambda s : u'' . join ( [ ( ( u'\\' + c ) if ( c in esc_chars ) else c ) for c in s ] ) )
function generator for escaping special characters .