Python CGI Escape Functions
Just an aide-memoire here.
- cgi.escape - replace <, > and & with HTML escapes; use for writing arbitrary strings in HTML text
- urllib.quote - replace URL-unsafe characters with URL escapes; use for generating URLs, typically ones involving query
strings
- urllib.quote_plus - like urllib.quote, but also uses pluses for spaces (urllib.quote leaves spaces alone?)