From 2f180bdafd2f76cc73a03878661d5dfc780fe8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrea=20G=C3=B3ralczyk?= Date: Sat, 2 Jun 2018 20:23:24 +0000 Subject: [PATCH] rozwiazanie cw5 --- labs04/cw5.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 labs04/cw5.py diff --git a/labs04/cw5.py b/labs04/cw5.py new file mode 100644 index 0000000..233565b --- /dev/null +++ b/labs04/cw5.py @@ -0,0 +1,17 @@ +import glob + +sciezka = "/home/andrea/Pulpit/scores/model.iter*.npz.bleu" + +for file in glob.glob(sciezka): + with open(file, 'r') as plik: + for line in plik.readlines(): + bleu = float(line[line.find("=")+ 1:line.find(",")]) + if bleu >0: + max = bleu + maxi = file + + plik.close() + +print ( maxi ) + +