Quick read and write lists to file May 27, 2012 • Noel Reading from a file: with open('input.txt') as f: lines = f.read().splitlines() Writing back out: with open('output.txt', 'w') as f: for el in elems: f.write(el + '\n')