Using Multiple File Handles for Single File
- by Ryan Rosario
I have an O(n^2) operation that requires me to read line i from a file, and then compare line i to every line in the file. This repeats for all i.
I wrote the following code to do this with 2 file handles, but it does not yield the result I am looking for. I imagine this is a simple error on my part.
IN1 = open("myfile.dat","r")
IN2 =…