Python 数据处理 open函数newline用法

If csvfile is a file object, it should be opened with newline=''.

with open(r'C:UsersHanjuDesktopuploadPortal(5).csv',"w", newline='') as _csvfile:
writer = csv.writer(_csvfile)

原文地址:https://www.cnblogs.com/hello-bug/p/12044634.html