the below code is to iterate through multiple files:
file_in = list()
filenames = ['C:\\textfile1.txt', 'C:\\textfile2.txt']
x = 0
for i in filenames:
file_in[x] = open(i,'r')
x += 1
but it did not work, it gave the following error message:
IndexError: list assignment index out of range.
Any idea to solve it ,thanks you