Writing a list to a file with Python,outfile.write('\n'.join(itemlist))