Skip to content

Instantly share code, notes, and snippets.

@vaibhaw
Created December 3, 2014 21:23
Show Gist options
  • Save vaibhaw/0458a713afaaee920680 to your computer and use it in GitHub Desktop.
Save vaibhaw/0458a713afaaee920680 to your computer and use it in GitHub Desktop.
some useful Python scripts for everyday tasks
def get_subdirs_in_folder(folder):
# subdir_list = []
# for path, subdirs, files in os.walk(folder):
# subdir_list.extend(subdirs)
dir_files = [os.path.join(folder,files) for files in os.listdir(folder)]
subdir_list = filter(os.path.isdir, dir_files)
return subdir_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment