About 233,000 results
Open links in new tab
  1. python - Do I understand os.walk right? - Stack Overflow

    Jun 12, 2012 · Just in case anyone else stumbles across this after doing a search for os.walk and "breadth-first" - the above information is incorrect. os.walk (at least in python 2.6 and 2.7) does …

  2. What is the Python way to walk a directory tree? - Stack Overflow

    Python even has a method extend with a less subtle syntax that is specifically made to handle the case in which you want to modify in place a list object by adding at the end the elements of …

  3. file walking in python - Stack Overflow

    Jan 3, 2011 · The function os.walk recursively walks through a directory tree, returning all file and subdirectory names. So all you have to do is detect the .x and .xc extensions from the …

  4. How does the iteration of os.walk work in Python 3?

    Mar 7, 2019 · 1 According to the Python 3 docs os.walk returns a 3-tuple. However, this does not work:

  5. Using os.walk() to recursively traverse directories in Python

    Jun 6, 2013 · Using os.walk () to recursively traverse directories in Python Asked 12 years, 7 months ago Modified 6 months ago Viewed 495k times

  6. python - os.walk without digging into directories below - Stack …

    Oct 23, 2008 · In Python 3 you can write root, dirs, files = next(os.walk(dir_name)) and then the variables root, dirs, files will only correspond to the variables of the generator at the dir_name …

  7. python - In what order does os.walk iterates iterate? - Stack …

    os.walk() yields in each step what it will do in the next steps. You can in each step influence the order of the next steps by sorting the lists the way you want them. Quoting the 2.7 manual: …

  8. python - Filtering os.walk () dirs and files - Stack Overflow

    Feb 28, 2011 · I'm looking for a way to include/exclude files patterns and exclude directories from a os.walk() call. Here's what I'm doing by now: import fnmatch import os includes = ['*.doc', …

  9. directory - python os.walk to certain level - Stack Overflow

    python os.walk to certain level [duplicate] Asked 8 years, 10 months ago Modified 3 years, 9 months ago Viewed 34k times

  10. Python os.path.walk() method - Stack Overflow

    The first argument to your callback function is the last argument of the os.path.walk function. Its most obvious use is to allow you to keep state between the successive calls to the helper …