with open('test-A/in.tsv') as f_in, open('test-A/out.tsv','w') as f_out: for line in f_in: f_out.write('0.8\n')