list of lists to csv

作者: 钊钖 | 来源:发表于2018-03-14 23:28 被阅读3次
image

a_list is a list of lists.which has already cleaned from drity.

a_list = [
[a,b,c],
[c,d,e]
]# b_list = [a,b,c]

now want change a_list to a csv file.

image

open w+b model cause a error ....sub_list is not 'str' .

if don't use the lineterminator, the new csvfile will appear empty line.

ifa_list is not list of lists is better use open wb model, that can avoide the space or empty line.

相关文章

网友评论

    本文标题:list of lists to csv

    本文链接:https://www.haomeiwen.com/subject/ndzqqftx.html