Chris Rebert wrote:
On Sat, Nov 8, 2008 at 9:16 PM, John Smith <[EMAIL PROTECTED]> wrote:
Hi,

I coded a python script that lets me parse a csv file into html code with a
certain format, but I would like to replace every "<" and ">" character that
appears within each column entry of the csv file (they are parsed as
strings) with the html equivalents of "&lt;" and "&gt;".

FYI: Python strings do have a .replace method,
but for the above application

You want the cgi.escape() function -
http://docs.python.org/library/cgi.html#cgi.escape

*is* what you should use, as it will do all needed replacements in one call.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to