ESP8266 Treppenlichtsteuerung mit OTA zum Firmware Upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

create_gz_files.py 369B

123456789101112131415
  1. #!/usr/bin/python3
  2. import os, gzip
  3. # https://stackoverflow.com/questions/8156707/gzip-a-file-in-python
  4. src_dir='data'
  5. out_dir='data_gz'
  6. if not 'data_gz' in os.listdir():
  7. os.mkdir('data_gz')
  8. for f in os.listdir(src_dir):
  9. with open(f'{src_dir}/{f}', 'rb') as f_in:
  10. with gzip.open(f'{out_dir}/{f}.gz', 'wb') as f_out:
  11. f_out.writelines(f_in)