9 lines
170 B
Python
Executable File
9 lines
170 B
Python
Executable File
#!/usr/bin/python3
|
|
import gzip
|
|
import shutil
|
|
|
|
with open('test.txt', 'rb') as f_in:
|
|
with gzip.open('test.gz', 'wb') as f_out:
|
|
shutil.copyfileobj(f_in, f_out)
|
|
|