forked from tdwojak/Python2018
Rozwiazanie zadania 5 z labs04
This commit is contained in:
parent
3fc2e3d36f
commit
29c7780e68
27
labs04/Rozwiazanie 5.py
Normal file
27
labs04/Rozwiazanie 5.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import glob
|
||||||
|
|
||||||
|
slownik = {}
|
||||||
|
for file in glob.glob("scores/*.npz.bleu"):
|
||||||
|
plik = open(file,"r")
|
||||||
|
plik.seek(7)
|
||||||
|
odczyt = plik.read(5)
|
||||||
|
|
||||||
|
for i in odczyt:
|
||||||
|
if ord(i) == 44:
|
||||||
|
slownik[file] = "0" + odczyt[:-2] + "0"
|
||||||
|
else:
|
||||||
|
slownik[file] = odczyt
|
||||||
|
|
||||||
|
plik.close()
|
||||||
|
|
||||||
|
#print(slownik)
|
||||||
|
|
||||||
|
wartosci = list(slownik.viewvalues())
|
||||||
|
#print wartosci
|
||||||
|
wartosci = max(wartosci)
|
||||||
|
#print wartosci
|
||||||
|
|
||||||
|
for l in slownik:
|
||||||
|
if slownik[l] == wartosci:
|
||||||
|
print l
|
||||||
|
|
Loading…
Reference in New Issue
Block a user