/ Published in: Python
Given a directory path, return true if that directory contains at least one other directory. Otherwise, return false.
Expand |
Embed | Plain Text
def containsDir (dirPath): contents=os.listdir(dirPath) dirList=[item for item in contents if os.path.isdir(os.path.join(dirPath,item))] return not dirList==list()
You need to login to post a comment.
