I am trying to zip some files present in a directory. Zipping is done successfully, but size doesn't seem to compress a lot.
My code :
import os
import zipfile
import sys
def zipdir(client, path):
os.chdir(path)
if client == 'ABC':
zipf = zipfile.ZipFile('Store.zip', 'w')
zipf.write('Facts.txt')
for f in os.listdir(path):
if f.endswith('.txt') or f.endswith('.xls'):
if 'pretty' in f:
zipf.write(f)
zipf.close()
When I try to zip it in unix shell script, the size becomes 40M. But When I try to zip it in Python, size is 196M
Any suggestions ?