我寫入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'