Skip to content

Instantly share code, notes, and snippets.

@fredrikaverpil
Created March 25, 2014 13:04
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 fredrikaverpil/9761408 to your computer and use it in GitHub Desktop.
Save fredrikaverpil/9761408 to your computer and use it in GitHub Desktop.
Get subdirectory of directory #python
def getSubdirs( directory ):
for item in os.listdir( directory ):
# print path to all subdirectories first.
if os.path.isdir( os.path.join( directory, item ) ):
print item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment