Skip to content

Instantly share code, notes, and snippets.

@konstantinfarrell
Last active July 3, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konstantinfarrell/0d34f221a4cefae92275df3a1b2299d4 to your computer and use it in GitHub Desktop.
Save konstantinfarrell/0d34f221a4cefae92275df3a1b2299d4 to your computer and use it in GitHub Desktop.
Recursive directory walk function in Python.
import os
def directory_walk(path):
for item in os.listdir(path):
if os.path.isdir(item):
directory_walk(item)
else:
print(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment