Python 3.2 and html.escape function

Discussion in 'Python' started by Gerald Britton, Feb 20, 2011.

  1. Forgot to include the reference:

    http://docs.python.org/dev/whatsnew/3.2.html

    html
    A new html module was introduced with only a single function,
    escape(), which is used for escaping reserved characters from HTML
    markup:

    >>> import html
    >>> html.escape('x > 2 && x < 7')

    'x &gt; 2 &amp;&amp; x &lt; 7'

    --
    Gerald Britton
    Gerald Britton, Feb 20, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Dupont

    Html escape text

    Lloyd Dupont, Jan 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    4,367
    Lloyd Dupont
    Jan 10, 2006
  2. harrelson
    Replies:
    3
    Views:
    3,868
    Craig Ringer
    Dec 10, 2004
  3. slomo
    Replies:
    5
    Views:
    1,494
    Duncan Booth
    Dec 2, 2007
  4. Gerald Britton

    Python 3.2 and html.escape function

    Gerald Britton, Feb 20, 2011, in forum: Python
    Replies:
    5
    Views:
    1,261
    Martin v. Loewis
    Feb 21, 2011
  5. khinester

    how to escape and pass html as variable

    khinester, Jul 19, 2010, in forum: Javascript
    Replies:
    1
    Views:
    86
    Martin Honnen
    Jul 19, 2010
Loading...

Share This Page