This question is related to Python concatenate text files
I have a list of file_names, like ['file1.txt', 'file2.txt', ...].
I would like to open all the files into a single file object that I can read through line by line, but I don't want to create a new file in the process. Is that possible?
with open(file_names, 'r') as file_obj:
line = file_obj.readline()
while line:
...