このページに関してのお問い合わせはこちら
Pythonのお勉強 Part22
ツイート
177
:
デフォルトの名無しさん
:
2007/12/12(水) 20:44:17
>>175
これ便利だよね関数にタプル渡して処理してくの
def getSafeText(self, text):
htmlFixes = [ ("&", "&"), ("<", "<"), (">", ">"), ]
for fix in htmlFixes:
text = text.replace(*fix)
return text