# stworz format pliku wyjsciowego for d in 'dev-0', 'test-A': with open(f'../../{d}/in.tsv') as f_in, open(f'../../{d}/out.tsv','w') as f_out: for line in f_in: pred_path = f'predictions/{d}/labels/' + line.rstrip().replace('jpg','txt') + '-nonrelative' try: s = open(pred_path).read() f_out.write(s + '\n') except FileNotFoundError: f_out.write('\n')