django: from django.utils.html import escape print escape(‘Q & A’) python标准库,3.x为:html.entities,python2.x里对应的是htmlentitydefs模块 3.x: …