with open('file_name.txt', 'a') as f:         f.write(file + '\n')

Read more of this post