使用Python3.3,下面的代码运行良好
import csv
with open(foname, "w", newline='') as outstream:
csv.writer(outstream, delimiter =' ').writerows(
[cell.value for cell in row]
for row in ws.rows
)
然而,python-2无法运行它,并表示
with open(foname, "w", newline='') as outstream:
TypeError: 'newline' is an invalid keyword argument for this function
什么是以前的版本的等价物?
https://stackoverflow.com/questions/45182720
复制相似问题