>>> import cgi >>> >>> test_string = "This is <unsafe> string & it contains wrong symbols" >>> >>> print cgi.escape(test_string) This is <unsafe> string & it contains wrong symbols
Monday, June 27, 2011
Make string html-safe
To make a string HTML-safe (convert & to &, > to > and so forth):
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.