Andrew Robert <[EMAIL PROTECTED]> wrote: > ValueError: invalid literal for int(): % > > Does anyone see what I am doing wrong? >
Try getting rid of the lamba, it might make things clearer and it simplifies debugging. Something like(this is just a sketch): def callback(match): print match.group() return chr(int(match.group(),16)) % ord(match.group()) output.write(re.sub('r([^\w\s])', callback, line) It looks like your match.group is a '%' character: >>> int('%', 16) Traceback (most recent call last): File "<pyshell#108>", line 1, in ? int('%', 16) ValueError: invalid literal for int(): % >>> max -- http://mail.python.org/mailman/listinfo/python-list