import os.path import sys import os.path arguments = sys.argv[1:] build_no = arguments[0] result = "" if os.path.exists("rmse.txt"): with open("rmse.txt", "r") as file: for line in file.readlines(): result = line with open("bulk_metrics.txt", "w") as file: file.write(build_no + " " + result)