If anyone could point me in the right direction I'd be really grateful. I am looking to replace the following:
file1 = open ('filepath')
file1.write(data1)
file2 = open ('filepath2')
file2.write(data2)
file3 = open ('filepath3')
file3.write(data3)
With something like this which can be iterated through:
file[i] = open ('filepath')
file[i].write(data[i])
The reason they all need different names is because all the files must be open at once without closing. This is just a requirement of the system.
Is there any way in which this can be done?