Is this the cleanest way to write a list to a file, since writelines() doesn\'t insert newline characters?
writelines()
file.writelines([\"%s\\n\" % item fo
Serialize list into text file with comma sepparated value
mylist = dir() with open('filename.txt','w') as f: f.write( ','.join( mylist ) )