All pastes #191336 Raw Edit

Someone

public text v1 · immutable
·published 2006-10-04 21:32 UTC
rendered paste body
def getsubdirs(dir):
    if (not os.path.isdir(dir)):
        raise IOError, 'getsubdirs() requires a directory'
    files = os.listdir(dir)
    dirsonly = []
    for f in files:
        #print("%s\n" % os.path.join(dir, f))
        if (os.path.isdir(os.path.join(dir, f))):
            dirsonly.append(f)
    return dirsonly