我的代码是:
c = csv.writer(open("addresses.csv", "wb"), quoting=csv.QUOUTE_ALL)
temp = open("temp_address.txt") //this contains a string, like this "1234567890ABCDEF"
c.writerow([temp.read(), "customers withdraw"])
.csv文件以此结尾
"1234567890ABCDEF
","Customers widthraw"
为什么会这样?我很感激帮助修复这个
答案 0 :(得分:2)
看起来该文件最后有一个换行符。您可能希望.strip()
结果。
e.g:
c.writerow([temp.read().strip(), "customers withdraw"])