ayi Utilisez os.path.join(). Exemple : os.path.join(pathfile,"output","log.txt"). Dans votre code, cela donnerait : rootTree.write(os.path.join(pathfile,"output","log.txt"))