import glob globIterator = glob.iglob(path, recursive=True) run = True while(run == True): try: print(next(globIterator)) except: run = False