with open('assignmentTest.csv', 'wb') as finale:
writer = csv.writer(finale) #creates csv file to write final lists into
finalRows = zip(firstName, lastName, phdName, universityName, departmentName) #put all of the lists into another lists so that the outputs are in 'column form' as opposed to rows
for rowToken in finalRows: #puts each element of each list together in the same order
writer.writerow(rowToken)
我试图找到一种有效的方法来将列表转换成utf8
格式,同时又不破坏我的writer.writerow(rowToken)
-基本上就是我用来为列表创建单独列的方法。在
@dimitrijim现在删除的答案是正确的。您是否意外地使用了
writerows
而不是writerow
?在以UTF-8编码的输出文件内容:
^{pr2}$相关问题 更多 >
编程相关推荐