Ubuntu Pastebin

Paste from soupnanodesukar at Sat, 12 Mar 2016 09:42:44 +0000

Download as text
 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'
Download as text