This time to bring you a CSS file format script method, CSS file format script considerations are what, the following is the actual case, take a look.
#!/usr/bin/python#-*-coding:utf-8-*-import sys,osdef format (DDT): DDT = ddt.replace (' \ n ', ') #去除换行 ddt= Ddt.replace (';} ', '} '). replace ('; ', '; \ n '). Replace (' {', ' {\ n '). Replace ('} ', ' \n}\n ') #重新换行 lines = ddt.split ("\ n" ) #读取全部换行内容 ddt= "for line in lines : ddt=ddt+line.strip (") + "\ n" #去除每行前面空格 return Ddt.replace ( ' {\ n ', ' {\ n '). replace ('; \ n ', '; \ n ') #空格整理for file in sys.argv: if file!=sys.argv[0] and Os.path.isfile ( file) and (str (file). Split (".") [-1]). Lower () = = "CSS": print U "Reading-", file newfile = open (file, "R") F=format (Newfile.read ()) NewFile =open (file, ' W ') newfile.write (f) newfile.close () print file, "-ok"
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Related reading:
Different versions of Vscdoe how to debug different versions Nodejs
Vuejs WEBP support for Image plugin development