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
Written by Skate Hunbash
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#