Recursing through directories

In some cases, it is necessary to iterate recursively through the main directory to discover new directories. In this example, we see how we can browse a directory recursively and retrieve the names of all files within that directory:

import os
# you can change the "/" to a directory of your choice
for file in os.walk("/"):
print(file)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.120.136