title: Is there a Python equivalent to the PHP function htmlspecialchars()?
body: <p>Is there a similar or equivalent function in Python to the PHP function htmlspecialchars()? The closest thing I've found so far is htmlentitydefs.entitydefs().</p>