## 编码
# Python2 & Python3
import cgi
cgi.escape('"<>')
# Python3
import html
html.escape('"<>')
## 解码
# Python2
import HTMLParser
HTMLParser.HTMLParser().unescape('"<>')
# Python3
import html
html.unescape('"<>')