-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 lol..
Glutton for punishment I guess. I tried removing the last parentheses but I then get an error that two arguments are passed when three are expected. Danny Yoo wrote: > > >> for line in open(r'e:\pycode\out_test.txt','rb') : >> output.write( re.sub(r'([^\w\s])', lambda s: chr(int(s.group(), >> 16))) % ord(s.group()), line)) > > > Let's add some whitespace. > > output.write(re.sub(r'([^\w\s])', > lambda s: chr( > int(s.group(), 16) > ) > ) % ord(s.group()), line)) > > I do see at least one too many parens here, so that's something you > should look at. > > But I'd also recommend writing a helper function here. Just because you > can do this in one line doesn't mean you have to. *grin* It might be > useful to change the lambda back to a helper function. > - -- Thank you, Andrew Robert Systems Architect Information Technologies MFS Investment Management Phone: 617-954-5882 E-mail: [EMAIL PROTECTED] Linux User Number: #201204 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFEdbtlDvn/4H0LjDwRAqg+AJ0SZY/T3kCpG+3qWX3F3yRSt73P7ACdFsZQ LnBhWh95EfuHA+eMkz6gkF4= =C0oN -----END PGP SIGNATURE----- _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor