Python gzip refuses to read uncompressed file

前端 未结 4 1689
一整个雨季
一整个雨季 2021-01-17 13:31

I seem to remember that the Python gzip module previously allowed you to read non-gzipped files transparently. This was really useful, as it allowed to read an input file wh

4条回答
  •  Happy的楠姐
    2021-01-17 14:27

    You can iterate over files transparently using fileinput(files, openhook=fileinput.hook_compressed)

提交回复
热议问题