Alors.. dans ce cas, voici ce que je te propose :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 lieu="TB1519" date = datetime.date.today().strftime("%d%m%Y") txt='' for fichier in [x for x in os.listdir("repertoire de recherche") if lieu+"_"+ date in x]: txt+=''.join([ligne for ligne in file(fichier) if 'nvoSpaceTemp' in ligne and not 18 < float(ligne.split()[-1]) < 27])+'\n' fichier_dest=open('FichierDeDestination','w') fichier_dest.write(txt) fichier_dest.close()
Partager