<s>[INST] Writing a list to a file with Python Is this the cleanest way to write a list to a file, since writelines() doesn't insert newline characters?
file.writelines(["%s\n" % item  for item in list])

It seems like there would be a standard way...
 [/INST] 
EDIT Adding info from Thomas' comment
Don't forget to open the file first
thefile = open('test.txt', 'w')

I'd use a loop:
for item in thelist:
  thefile.write("%s\n" % item)

or:
for item in thelist:
  print>>thefile, item

If you're keen on a single function call, at least remove the square brackets [] so that the strings to be printed get made one at a time (a genexp rather than a listcomp) -- no reason to take up all the memory required to materialize the whole list of strings.
 </s>