In order to create a program which can read the file and the starting line on the file is not empty or blank, which further enables the next four lines to be deciphered, what must one do? The calculations are performed on the lines and then the next line is readable. However, if that line isn’t empty, it still continues. However, this error persists:
ValueError: invalid literal for int() with base 10
Despite being able to understand and read the line at the start, the process of converting it to an integer is not working for me. What can I do to fix this problem?
file_to_read = raw_input("Enter file name of tests (empty string to end program):")
try: infile = open(file_to_read, 'r')
while file_to_read != " ":
file_to_write = raw_input("Enter output file name (.csv will be appended to it):")
file_to_write = file_to_write + ".csv"
outfile = open(file_to_write, "w")
readings = (infile.readline())
while readings != 0:
readings = int(readings)
minimum = (infile.readline())
maximum = (infile.readline())