[Tutor] Terminating "\M" characters with regard to csv.DictWriter

Cameron Simpson cs at cskk.id.au
Tue Aug 10 00:37:02 EDT 2021


On 09Aug2021 21:03, Alex Kleider <alexkleider at gmail.com> wrote:
>PS I need to ponder the following a bit more:-)
> >>> f = open("tmp.csv", "w", newline="")
>>  >>> csv.writer(f).dialect.lineterminator
>> '\r\n'

I'd imagine the empty string looks false, and falls back to the default.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list