This is supposed to create a zip file of a text file.
But the size of the zip file is no smaller?
-rw-rw-r-- 1 andy andy 557500 Oct 9 05:11 todays_files.txt
-rw-rw-r-- 1 andy andy 557630 Oct 9 05:09 newzip.zip
#! /usr/bin/python3.6
# Compressing a file Zip file is no smaller in size?
# chmod +rx (make script executable from anywhere)
import math
import zipfile
newzip=zipfile.ZipFile('/home/andy/Python/newzip.zip','w')
# File to compress
newzip.write('todays_files.txt')
newzip.close()
Also, some files do not meaningfully compress (eg video, which is
already low entropy). It is faster to not btoher to try. I guess these
inherently fall into Barry’s use case collection. I’ve certainly got an
explicit zip-but-do-not-compress use case where I’m working right now.