how do write a list of string into a csv file in python?
I have a list of strings with开发者_Python百科 spaces, periods, commas and semi colons and I'm wondering how do I get these into a csv file? I need each list of strings to correspond to one line.
with open('my.csv', 'w') as handle:
handle.write('\n'.join(list_of_strings))
? We need more info on your "list of strings" to know if you need to do any more than that.
Did you have a look to the csv module (especially the examples part )?
精彩评论