Hello!
There is a logical mistake here. You have a new line symbol on every line you read. So "s" is actually "<title>Le Dépositaire infidèle\n</title>".
So "</title>" goes to the next line because of /n before it. And then you add to the same line in the file the next one.
Try to change line 13 like that:
There is a logical mistake here. You have a new line symbol on every line you read. So "s" is actually "<title>Le Dépositaire infidèle\n</title>".
So "</title>" goes to the next line because of /n before it. And then you add to the same line in the file the next one.
Try to change line 13 like that:
s='<title>'+ t.strip() +'</title>'In order to understand what is going on just put a print statement somewhere in the for loop. Or more:
for i in range(10): t=str(folderFab.readline()) print(t) s='<title>'+ t +'</title>' print(s) tei.write(s)