List directories in python

Created 2014-05-29 Modified 2018-03-30

Its pretty straight forward to list files, by using:

import glob
print glob.glob("*")

Listing directories especially only those in current level requires the use of os.walk

os.walk('content/').next()[1]