From 10ddbf40ed82742f50f1dedccfead4d5a5971448 Mon Sep 17 00:00:00 2001 From: Magdalena Lewandowicz Date: Sat, 2 Jun 2018 20:48:43 +0200 Subject: [PATCH] zadanie --- labs04/zadanie5.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 labs04/zadanie5.py diff --git a/labs04/zadanie5.py b/labs04/zadanie5.py new file mode 100644 index 0000000..5ed100c --- /dev/null +++ b/labs04/zadanie5.py @@ -0,0 +1,16 @@ +import glob + +pliki = glob.glob('scores/*') +wyniki = [] + +for plik in pliki: + f = open(plik, 'r') + tekst = f.readline() + tekst = tekst.split(" ") + tekst = [x.strip(",") for x in tekst] + wyniki.append(tekst[2]) + +f.close() +index = wyniki.index(max(wyniki)) +sciezka = pliki[index] +print(sciezka) \ No newline at end of file