时间:2021-07-01 10:21:17 帮助过:4人阅读
os sys re xlwt Filelist = [] FileNum = bw = {} iops = {} (SubStrListStr): flag = substr SubStrList: (substr Str): flag = flag (startendstr): result = re.findall(+start++end+str) x result: x (): FlagStr = [] FileNum filename os.listdir(os.path.dirname(os.path.realpath(__file__))): (IsSubString(FlagStrfilename)): Filelist.append(filename) FileNum = FileNum + FileNum (filename): file = (filename) lst[] r=file.readline() (r) ==: r.count() ==(line): : lst.append(r) i lst: i (): i Filelist: ReadFile(i) (): wb = xlwt.Workbook() = wb.add_sheet() __name__==: GetFilelist() FileLoop()
以上就是使用python读取文件小程序的详细内容,更多请关注Gxl网其它相关文章!