import os.path transfo = open("Conversion/truc.html", 'r') contenu = transfo.read() index = { '---+++' : '

' ,'---+' : '

', '---++' : '

'} for cle in index: contenu=contenu.replace(cle, index[cle]) #ecriture = open("Conversion/truc.html", 'a') #ecriture.write(contenu) print contenu #