Most efficient way to open a file and read the lines?
I've got this:
vlgaStream = open('vlgaChcWaves.txt', 'r+') vlgaBuffer = vlgaStream.readlines() vlgaStream.close()
But need a way to directly and efficiently read all of the lines from a file into a buffer?
Iterating over a file yields lines.
with open('vlgaChcWaves.txt', 'r+') as vlgaStream: for line in vlgaStream: dosomethingwith(line)