rendered paste body#!/usr/bin/env pythonimport os# Settings.ShowTimestamp = FalseShowDirCount = FalseShowFileCount = FalseShowAverageFileSize = FalseShowTotalFileSize = Falsedef Traverse(Path): # Working values. global FileCount global DirCount global TotalFileSize # Get all children. try: Children = os.listdir(Path) except OSError, (errno, strerror): return for Child in Children: if os.path.isdir(Path + '/' + Child): DirCount += 1 Traverse(Path + '/' + Child) elif os.path.isfile(Path + '/' + Child): FileCount += 1 TotalFileSize += os.path.getsize(Path + '/' + Child)def GetTimestamp(): return "insert timestamp here"def GetDirCount(): return DirCountdef GetFileCount(): return FileCountdef GetAverageFileSize(): return TotalFileSize / FileCountdef GetTotalFileSize(): return TotalFileSize# Set initial global values.FileCount = 0DirCount = 0TotalFileSize = 0# Must not have trailing slash!Traverse('/home/michael/Desktop')print 'Timestamp =', GetTimestamp()print 'Directory Count =', GetDirCount()print 'File Count =', GetFileCount()print 'Average File Size =', GetAverageFileSize()print 'Total File Size =', GetTotalFileSize()