Iterate recursively through folder
import os def listfiles(root): files = [] for file in os.listdir(root): try: files = files + listfiles(root + '/' + file) except: files.append(file) return files