diff --git a/labs03/labs_zadanie5.py b/labs03/labs_zadanie5.py new file mode 100644 index 0000000..f2847a5 --- /dev/null +++ b/labs03/labs_zadanie5.py @@ -0,0 +1,34 @@ +import os +#a =[] + +#plik = file = open("model.iter10000.npz.bleu", "r") +#print(plik) + +def open_plik(source, file): + plik=file = open(os.path.join(source, file), "r") + #plik = file = open(file, "r") + for linia in plik.readlines(): + #print(linia.strip()) + test = linia.split(',') + test2 = test[0] + test3 = test2.split('=') + test4 = float(test3[1]) + plik.close() + return(test4) + +sub_dir = "J:\\PycharmProjects\\Python2017\\labs03\\scores" +Folder_list = os.listdir (sub_dir) +print(Folder_list) +value=0.0 +for i in Folder_list: + #print(i) + file = i + print(file) + check=float(open_plik(sub_dir,file)) + print(check,value) + if check>value: + file_name=os.path.join(sub_dir, file) + value= check + else: + pass +print("poprawna wartosc", value,"FILE:",file_name)