I have a file with 196 list in it,and I want to create new 196 output files and write each of the list in a new file, so that I will have 196 output files each containing 1
I think this is what you are looking for:
with open("/home/vidula/Desktop/project/ori_tri/inpt.data","r") as fn:
listLines = fn.readlines()
for fileNumber, line in enumerate(listLines):
with open("/home/vidula/Desktop/project/ori_tri/input{0}.data".format(fileNumber), "w") as fileOutput:
fileOutput.write(line)