From bec8e2ab49faf2c6ab5158b6c845f94c7120fbbc Mon Sep 17 00:00:00 2001 From: s411752 Date: Fri, 1 Jun 2018 00:40:13 +0200 Subject: [PATCH] laboratoria4 --- labs04/task05.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 labs04/task05.py diff --git a/labs04/task05.py b/labs04/task05.py new file mode 100644 index 0000000..7128b39 --- /dev/null +++ b/labs04/task05.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import glob + +lista_plikow = glob.glob('J:\PycharmProjects\Python2018\labs04\scores\*') + +wyniki=[] +for plik in lista_plikow: + tekst = open(plik, 'r') + tmp=[] + for linia in tekst.readlines(): + tmp=(linia.strip()).split(' ') + wyniki.append(float(tmp[2].replace(',',''))) + +max=wyniki[0] +for i in range(1, len(wyniki)): + if wyniki[i]>max: + max=wyniki[i] + max_iter = i + +print(lista_plikow[max_iter]) \ No newline at end of file