Python 3: gzip.open() and modes

后端 未结 2 486
情书的邮戳
情书的邮戳 2021-01-18 03:20

https://docs.python.org/3/library/gzip.html

I am considering to use gzip.open(), and I am a little confused about the mode argument:

2条回答
  •  梦谈多话
    2021-01-18 04:02

    It means that r defaults to rb, and if you want text you have to specify it using rt.

    (as opposed to open behaviour where r means rt, not rb)

提交回复
热议问题