db_archiver_4.py 240 B

1234567
  1. def compress_to_gzip(local_file_name):
  2. gzip_file_name = f'{local_file_name}.gz'
  3. fp = open(local_file_name, 'rb')
  4. with gzip.open(gzip_file_name, 'wb') as gz_fp:
  5. gz_fp.write(bytearray(fp.read()))
  6. return gzip_file_name