Hi, I'm having a bit of a problem outputting to a file. I am trying to output each element of a list into a document on a new line and I can only get it to work when all the items in the list are on the same line.
The code I am using is:
book=['1234', '1235', '1236', '1237', '1238']
s=str(book)
for a in book:
f=open('/home/tandberg/booklist', 'a')
f.write(a)
I have tried using the '\n'
in a number of different ways but can't get it to work properly.