文章图片
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.【list|list of lists to csv】if
a_list
is not list of lists is better use open wb
model, that can avoide the space or empty line.