我写入CSV语句无法正常工作;Python将列表写入CSV
我有一个列表中的每个字符串都需要写入他们自己的行在csv;
mylist = ['this is the first line','this is the second line'........]
with open("output.csv", "wb") as f:
writer = csv.writer(f)
writer.writerows(mylist)
问题是,我的输出被搞乱了,看起来像这样;
't,h,i,s, i,s, t,h,e, f,i,r,s,t, l,i,n,e,'.... etc.
我需要;
'this is the first line'
'this is the second line'