Last Updated: February 25, 2016
·
407
· gamebit07

Python Script to Compress all your css files

import cssmin, time, glob

outfilename = 'all_' + str((int(time.time()))) + ".css"

with open(outfilename, 'wb') as outfile:
    for fname in glob.glob('*.css'):
        with open(fname, 'r') as rawfile:
            minified_file = cssmin.cssmin(rawfile.read())
            outfile.write(minified_file)
        outfile.write('/* ================================end of ' + fname + '===========================================*/\n')

It has a dependency, so pip install cssmin