2015-07-28

PYTHON - List all first-level subdirectories

import os
os.chdir( '/YOUR/PATH/' )
for folder in sorted( os.listdir( os.getcwd() ) ):
    if not os.path.isfile( folder ):
        print folder

No comments:

Post a Comment