import glob path = "./*" files=glob.glob(path) for file in files: if file[-3:] == "odt": print(file[2:-3] + " " + "[HTML] [ ODT]" ) print("")