两级目录,可扩展为N级. # Count the line of dir or file import os, fnmatch, fileinput def ChkFileType(lst): tmp = lst FileType = ['asm', 'c', 'cpp', 'h', 'ucf', 'v', 'java', 'm'] for filename in tmp: flg = 1 for types in FileType: if fnmatch.fnmatch(filename.lo…