0

i give a path to a function and i want this funtion to watch in every folder in this path and if there is a folder inside of a folder : watch in too.

def function(path):
   for element in os.listdir(path):
       element_path = os.path.abspath(element)
       if os.isdir(element_path):
           path = os.path.join(path, element)
           function(path)
        elif ... # elif elment is an img do something

This code works but when there is a folder in a folder it doesn't work :/

icetom 54
  • 63
  • 7

0 Answers0