Skip to content

Instantly share code, notes, and snippets.

@nkint
Created December 4, 2013 16:35
Show Gist options
  • Save nkint/7790728 to your computer and use it in GitHub Desktop.
Save nkint/7790728 to your computer and use it in GitHub Desktop.
python as sh: print all the directory recursively
import os, sys
rootdir = sys.argv[1]
for root, subfolders, files in os.walk(rootdir):
dirs = [ os.path.abspath(rootdir)+ root[1:] + "/" + s for s in subfolders ]
for d in dirs: print d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment