Htmlizing text

Vespe Savikko vespe at cs.tut.fi
Tue Nov 30 06:41:19 CET 1999


Also sprach philh at vision25.demon.co.uk (Phil Hunt):

  Is there a function in the standard Python library to HTML-ize text,
  i.e. to replace 'a > b & c < d' with 'a > b & c < d'?
  
  (I realize this can be done with regular expressions, but is there
  an easy way?)

>>> import cgi
>>> cgi.escape( 'a > b & c < d' )
'a > b & c < d'

  ++Vespe
  
-- 
  ------------------------------------------------------------------
       Vespe Savikko     vespe at cs.tut.fi     - to doom de doomsday -




More information about the Python-list mailing list