I have a bunch of compressed files (.gz) and I want to merge them into a single one.
I am aware of CL tool:
cat file1.gz file2.gz > file.gz
and also I found this solution from stackoverflow:
with open(..., 'wb') as wfp:
for fn in filenames:
with open(fn, 'rb') as rfp:
shutil.copyfileobj(rfp, wfp)
However, Is there any other way of doing it through Python that is as efficient as cat?