Quoting HTML

Erik Max Francis max at alcyone.com
Thu Dec 5 05:15:16 EST 2002


Thomas Guettler wrote:

> cgi.escape() does not quote " or '

There's a second argument to cgi.escape, if you set it to true it will
replace double quotes with ":

>>> cgi.escape('&<>"')
'&<>"'
>>> cgi.escape('&<>"', True)
'&<>"'

Not sure why you would want to or think you need to HTML entity quote a
single quote.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Thousands have lived without love, not one without water.
\__/ W.H. Auden
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.



More information about the Python-list mailing list