How to search in path, but omit folders – python

I want to search XML files in folder: path = ‘C:/Users/STJ2TW/Desktop/TDD/TD/cell02/td/cell’ In this folder there are XML files and also two folders: supplemenet and serialno I want to find only XML files and omit these folders, so I’m doing code: path = ‘C:/Users/STJ2TW/Desktop/TDD/TD/cell02/td/cell’ for filename in os.listdir(path): if ‘.’ not in filename: if ‘MASTER’ not… Read More How to search in path, but omit folders – python