是否有与PHP函数htmlspecialchars()等效的Python? [英] Is there a Python equivalent to the PHP function htmlspecialchars()?
本文介绍了是否有与PHP函数htmlspecialchars()等效的Python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Python中是否有与PHP函数htmlspecialchars()类似或等效的函数?到目前为止,我找到的最接近的东西是htmlentitydefs.entitydefs().
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().
推荐答案
我最近知道的是 cgi.escape .
这篇关于是否有与PHP函数htmlspecialchars()等效的Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文