import os # CONFIG APPDIR = os.path.dirname( os.path.realpath(__file__) ) DATADIR = '%s/datas' % APPDIR CONFDIR = '%s/config' % APPDIR FOLDER = DATADIR MODEL_IGNORE = [] with open(".modelignore", "r") as file: for line in file: MODEL_IGNORE.append(line.strip()) conf_files = os.listdir( CONFDIR ) keyword = 'your_keyword' for file in conf_files: if os.path.isfile( os.path.join(CONFDIR,file) ): if file.endwith('.tsv'): eprint( 'Conf file: ', file ) f = open( os.path.join(CONFDIR,file), 'r' ) eprint( file[:-4], f.split() ) f.close()