I have a text file which I constantly append data to. When processing is done I need to gzip the file. I tried several options like shutil.make_archive
, tarfile
, gzip
but could not eventually do it. Is there no simple way to compress a file without actually writing to it?
Let's say I have mydata.txt file and I want it to be gzipped and saved as mydata.txt.gz.