1
2
3
4
5
6
7
8
9
10
11
12
13
14 | #!/usr/bin/env python import os def foldercount(path): count = 0 for f in os.listdir(path): child = os.path.join(path, f) if os.path.isdir(child): count = count + 1 return count subs = foldercount('.') if subs > 30: print 'more than 30' |