Pythonのお勉強 Part22

このエントリーをはてなブックマークに追加
177デフォルトの名無しさん
>>175
これ便利だよね関数にタプル渡して処理してくの

def getSafeText(self, text):
  htmlFixes = [ ("&", "&"), ("<", "<"), (">", ">"), ]
  for fix in htmlFixes:
    text = text.replace(*fix)
  return text