Does Python csv writer always use DOS end-of-line characters?

前端 未结 1 1962
别那么骄傲
别那么骄傲 2021-02-11 13:15

I realize that the csv library in Python always generates DOS end-of-line characters. Even if I use the \'wb\' mode, even if I use Linux.



        
相关标签:
1条回答
  • 2021-02-11 13:36

    You can give your writer instance a custom lineterminator argument in the constructor:

    writer = csv.writer(f, lineterminator="\n")
    
    0 讨论(0)
提交回复
热议问题