开发者

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 )?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜