0

I need to enter each folder within a specific folder, and so on until there are no more nested folders, I need to read files that are inside each folder, but my question is: is there any method in the module or another which automates this?

thanks

kaya3
  • 47,440
  • 4
  • 68
  • 97
  • 1
    This question is too broad. You need to be more specific as to what you would like to do and provide any code samples of what you've tried. In example "I need to read files", what do you mean by read files? Do you need to out put the data, save it? – FabricioG Feb 14 '20 at 17:46
  • 3
    Maybe search for ["python visit files recursively"](https://www.google.com/search?q=python+visit+files+recursively) - there are many examples. – user2864740 Feb 14 '20 at 17:50
  • 3
    Second result was for https://stackoverflow.com/q/2212643/2864740 which uses `os.walk` - YMMV. – user2864740 Feb 14 '20 at 17:51
  • 2
    Does this answer your question? [How to traverse through the files in a directory?](https://stackoverflow.com/questions/4918458/how-to-traverse-through-the-files-in-a-directory) – mkrieger1 Feb 14 '20 at 17:58
  • 1
    All your answers helped me, thank you very much everyone. –  Feb 14 '20 at 18:29
  • @FabricioG, I need to read them, read the files in the current folder, enter the subdirectories within it and read them also the files they have inside and so on. But os.walk () seems to work for this, as I see. –  Feb 14 '20 at 18:30
  • https://stackoverflow.com/questions/2212643/python-recursive-folder-read – FabricioG Feb 14 '20 at 22:36

0 Answers0