for dpath, dnames, fnames in os.walk('.'):
    for i, fname in enumerate([os.path.join(dpath, fname) for fname in fnames]
        ):
        if fname.endswith('.png'):
            pass
Функция Python, похожая на команду bash find