1、#定义函数,用于打开指定类型文件的函数def open_allfile(path,filetype): data=[] import glob import os read_files=glob.glob(path+'*'+filetype) for i in read_files: with open(i,'rb') as infile: data.append(infile.read()) return datapath指定路径;filetype指定文件类型。

3、#测试path='C:\\Users\\jyjh\\Desktop\\soures\high_CG_pathogen\\'filetype='.txt'data=open_allfile(path,filetype)name=get_filename(path,filetype)name
