Save files on the fly

Hello

I have a big list call abc which I will keep appending tensor to it. The problem is that if I keep processing my list, and then save it at the end, it is likely to run out of memory. How do I keep appending my data to a save file?

for i in range(10000000):
    abc.append(i+1)
    #how do I save the abc on the fly?