📜  python gzip 文件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:32.485000             🧑  作者: Mango

代码示例3
import gzip
import shutil
with open('/home/joe/file.txt', 'rb') as f_in:
    with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)