import os, sys, time

# List here the the directories you want to count and that you want not

tops = ["D:\\"]
skip = ["D:\\HELKA"]

table = {}
for year in range(1980, time.localtime().tm_year + 1):
  table[year] = 0

for top in tops:
  for root, dirs, files in os.walk(top):
    if True in [root.upper().startswith(dir) for dir in skip]:
      continue
    for name in files:
      try:
        file = os.path.join(root, name)
        mtime = os.path.getmtime(file)
        year = time.localtime(mtime).tm_year
        table[year] += 1
      except:
        print >> sys.stderr, file

for year, count in table.items():
  print year, count
