python decompress gzip file

Solutions on MaxInterview for python decompress gzip file by the best coders in the world

showing results for - "python decompress gzip file"
Gwenaëlle
26 Oct 2019
1import gzip
2import shutil
3with gzip.open('file.txt.gz', 'rb') as f_in:
4    with open('file.txt', 'wb') as f_out:
5        shutil.copyfileobj(f_in, f_out)