if '-a' in relation[desfile]: print(info.line_detail()) str += info.line_detail() + '\n' if outputfile != "": info.write_file(outputfile, str) # deal with the single file else: thisfile = FileInfo(cur_file_dir(), desfile) thisstr = "" if '-c' in relation[desfile]: print(thisfile.char_num()) thisstr += thisfile.char_num() + '\n' if '-w' in relation[desfile]: if prelistfile != "": # get the preserved word list prelist = get_prelist(prelistfile) print(thisfile.word_num(prelist)) thisstr += thisfile.word_num(prelist) + '\n' else: print(thisfile.word_num([])) thisstr += thisfile.word_num([]) + '\n' if '-l' in relation[desfile]: print(thisfile.line_num()) thisstr += thisfile.line_num() + '\n' if '-a' in relation[desfile]: print(thisfile.line_detail()) thisstr += thisfile.line_detail() + '\n' if outputfile != "": thisfile.write_file(outputfile, thisstr)