python包含一个cgi模块,该模块有一个escape函数可以用来对html代码进行编码转换
import cgi s1 = "Hello <strong>world</strong>" s2 = cgi.escape(s1) assert s2 == "Hello <strong>world</strong>"
python包含一个cgi模块,该模块有一个escape函数可以用来对html代码进行编码转换
import cgi s1 = "Hello <strong>world</strong>" s2 = cgi.escape(s1) assert s2 == "Hello <strong>world</strong>"