-2

I am wondering about a good way to isolate just the folders in any given directory. Right now I have a folder with both, folders and random files in it and I want to isolate just the folders and ignore the files, whatever they may be called. Is there a quick way to do this in python?

Cheers

Npok
  • 3
  • 1
  • 2
  • What do you mean by "Isolate?" – ifconfig Jul 04 '17 at 03:45
  • Say I have a folder called Scenes, inside scenes I have more folders, but also some files e.g text.txt, text.mp3. I want to ignore all the files and select just the folders. Hope that makes sense. – Npok Jul 04 '17 at 03:46
  • https://stackoverflow.com/questions/7781545/how-to-get-all-folder-only-in-a-given-path-in-python – Sachin Gade Jul 04 '17 at 03:51
  • Possible duplicate of [Getting a list of all subdirectories in the current directory](https://stackoverflow.com/questions/973473/getting-a-list-of-all-subdirectories-in-the-current-directory) – A. J. Parr Jul 04 '17 at 03:54

1 Answers1

1

This may be a duplicate question. Please check out this link and see if it serves your purpose :

How to list only top level directories in Python?

xeon
  • 895
  • 9
  • 15