I am creating a program that reads a file and if the first line of the file is not blank, it reads the next four lines. Calculations are performed on those lines and then t
I got into the same issue when trying to use readlines() inside for loop for same file object... My suspicion is firing readling() inside readline() for same file object caused this error.
Best solution can be use seek(0) to reset file pointer or Handle condition with setting some flag then create new object for same file by checking set condition....